mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-16 10:09:28 +02:00
spotify: fixed loves export count
This commit is contained in:
parent
28ed1183e4
commit
7a2fcc091e
1 changed files with 5 additions and 3 deletions
|
@ -153,7 +153,8 @@ func (b *SpotifyApiBackend) ExportLoves(oldestTimestamp time.Time, results chan
|
|||
defer close(results)
|
||||
|
||||
p := models.Progress{Total: int64(perPage)}
|
||||
var totalCount int
|
||||
totalCount := 0
|
||||
exportCount := 0
|
||||
|
||||
out:
|
||||
for {
|
||||
|
@ -187,11 +188,11 @@ out:
|
|||
if love.Created.Unix() > oldestTimestamp.Unix() {
|
||||
loves = append(loves, love)
|
||||
} else {
|
||||
totalCount -= 1
|
||||
break
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
exportCount += len(loves)
|
||||
sort.Sort(loves)
|
||||
results <- models.LovesResult{Items: loves, Total: totalCount}
|
||||
p.Elapsed += int64(count)
|
||||
|
@ -208,6 +209,7 @@ out:
|
|||
}
|
||||
}
|
||||
|
||||
results <- models.LovesResult{Total: exportCount}
|
||||
progress <- p.Complete()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue