mirror of
https://git.sr.ht/~phw/scotty
synced 2025-05-10 18:27:03 +02:00
Subsonic: Partial support for some OpenSubsonic tags
This commit is contained in:
parent
68b2e649f0
commit
0b5f699383
4 changed files with 18 additions and 1 deletions
|
@ -88,11 +88,22 @@ func SongAsLove(song subsonic.Child, username string) models.Love {
|
|||
ArtistNames: []string{song.Artist},
|
||||
TrackNumber: song.Track,
|
||||
DiscNumber: song.DiscNumber,
|
||||
Tags: []string{song.Genre},
|
||||
RecordingMbid: models.MBID(song.MusicBrainzId),
|
||||
Tags: []string{},
|
||||
AdditionalInfo: map[string]any{},
|
||||
Duration: time.Duration(song.Duration * int(time.Second)),
|
||||
},
|
||||
}
|
||||
|
||||
if len(song.Genres) > 0 {
|
||||
genres := make([]string, 0, len(song.Genres))
|
||||
for _, genre := range song.Genres {
|
||||
genres = append(genres, genre.Name)
|
||||
}
|
||||
love.Track.Tags = genres
|
||||
} else if song.Genre != "" {
|
||||
love.Track.Tags = []string{song.Genre}
|
||||
}
|
||||
|
||||
return love
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue