1
0
Fork 0
mirror of https://git.sr.ht/~phw/scotty synced 2025-04-25 05:47:57 +02:00

subsonic: fixed filtering songs based on timestamp

This commit is contained in:
Philipp Wolfer 2023-12-01 11:48:23 +01:00
parent 8a1cd8ded7
commit a4a05ea047
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B

View file

@ -66,11 +66,11 @@ func (b *SubsonicApiBackend) ExportLoves(oldestTimestamp time.Time, results chan
}
func (b *SubsonicApiBackend) filterSongs(songs []*subsonic.Child, oldestTimestamp time.Time) models.LovesList {
loves := make(models.LovesList, len(songs))
for i, song := range songs {
loves := make(models.LovesList, 0, len(songs))
for _, song := range songs {
love := SongAsLove(*song, b.client.User)
if love.Created.Unix() > oldestTimestamp.Unix() {
loves[i] = love
loves = append(loves, love)
}
}