subsonic: only set tags if genre is non-empty

This commit is contained in:
Philipp Wolfer 2023-12-10 01:33:14 +01:00
parent acb0e9cb11
commit 6eaef18188
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B

View file

@ -105,11 +105,14 @@ func SongAsLove(song subsonic.Child, username string) models.Love {
ArtistNames: []string{song.Artist},
TrackNumber: song.Track,
DiscNumber: song.DiscNumber,
Tags: []string{song.Genre},
AdditionalInfo: map[string]any{},
Duration: time.Duration(song.Duration * int(time.Second)),
},
}
if song.Genre != "" {
love.Track.Tags = []string{song.Genre}
}
return love
}