mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-16 10:09:28 +02:00
ListenBrainz: Fixed loves pagination
This commit is contained in:
parent
719ef5b84b
commit
ebcec46d7a
2 changed files with 5 additions and 6 deletions
|
@ -80,6 +80,7 @@ func (c Client) GetFeedback(user string, status int, offset int) (result GetFeed
|
|||
"status": strconv.Itoa(status),
|
||||
"offset": strconv.Itoa(offset),
|
||||
"count": strconv.Itoa(c.MaxResults),
|
||||
"metadata": "true",
|
||||
}).
|
||||
SetResult(&result).
|
||||
Get(path)
|
||||
|
|
|
@ -78,8 +78,6 @@ out:
|
|||
|
||||
func (b ListenBrainzApiBackend) ExportLoves(oldestTimestamp time.Time) ([]models.Love, error) {
|
||||
offset := 0
|
||||
// perPage := MaxItemsPerGet
|
||||
|
||||
loves := make([]models.Love, 0, 2*MaxItemsPerGet)
|
||||
|
||||
out:
|
||||
|
@ -103,7 +101,7 @@ out:
|
|||
}
|
||||
}
|
||||
|
||||
offset += 1
|
||||
offset += MaxItemsPerGet
|
||||
}
|
||||
|
||||
slices.Reverse(loves)
|
||||
|
|
Loading…
Add table
Reference in a new issue