mirror of
https://git.sr.ht/~phw/scotty
synced 2025-05-09 18:07:03 +02:00
listenbainz: fixed loves export not considering timestamp
This commit is contained in:
parent
c305b6c7e3
commit
21d757e37c
1 changed files with 1 additions and 6 deletions
|
@ -199,7 +199,7 @@ func (b *ListenBrainzApiBackend) ExportLoves(oldestTimestamp time.Time, results
|
|||
exportChan := make(chan models.LovesResult)
|
||||
p := models.Progress{}
|
||||
|
||||
go b.exportLoves(time.Unix(0, 0), exportChan)
|
||||
go b.exportLoves(oldestTimestamp, exportChan)
|
||||
for existingLoves := range exportChan {
|
||||
if existingLoves.Error != nil {
|
||||
progress <- p.Complete()
|
||||
|
@ -219,7 +219,6 @@ func (b *ListenBrainzApiBackend) exportLoves(oldestTimestamp time.Time, results
|
|||
offset := 0
|
||||
defer close(results)
|
||||
loves := make(models.LovesList, 0, 2*MaxItemsPerGet)
|
||||
p := models.Progress{}
|
||||
|
||||
out:
|
||||
for {
|
||||
|
@ -248,15 +247,11 @@ out:
|
|||
love := feedback.AsLove()
|
||||
if love.Created.After(oldestTimestamp) {
|
||||
loves = append(loves, love)
|
||||
p.Elapsed += 1
|
||||
} else {
|
||||
break out
|
||||
}
|
||||
}
|
||||
|
||||
p.Total = int64(result.TotalCount)
|
||||
p.Elapsed += int64(count)
|
||||
|
||||
offset += MaxItemsPerGet
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue