From a4a05ea047a4ac3e018b536de8be10cc00f9bf70 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Fri, 1 Dec 2023 11:48:23 +0100 Subject: [PATCH] subsonic: fixed filtering songs based on timestamp --- internal/backends/subsonic/subsonic.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/backends/subsonic/subsonic.go b/internal/backends/subsonic/subsonic.go index 732b9ab..2d42fff 100644 --- a/internal/backends/subsonic/subsonic.go +++ b/internal/backends/subsonic/subsonic.go @@ -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) } }