@@ -544,6 +544,15 @@ func toTrack(ch *subsonic.Child) *mediaprovider.Track {
544544 artistIDs = append (artistIDs , ch .ArtistID )
545545 }
546546
547+ var albumArtistNames , albumArtistIDs []string
548+ if len (ch .AlbumArtists ) > 0 {
549+ // OpenSubsonic extension
550+ for _ , a := range ch .AlbumArtists {
551+ albumArtistIDs = append (albumArtistIDs , a .ID )
552+ albumArtistNames = append (albumArtistNames , a .Name )
553+ }
554+ }
555+
547556 var rGain mediaprovider.ReplayGainInfo
548557 if rg := ch .ReplayGain ; rg != nil {
549558 rGain .AlbumGain = rg .AlbumGain
@@ -570,35 +579,39 @@ func toTrack(ch *subsonic.Child) *mediaprovider.Track {
570579 }
571580
572581 return & mediaprovider.Track {
573- ID : ch .ID ,
574- CoverArtID : ch .CoverArt ,
575- ParentID : ch .Parent ,
576- Title : ch .Title ,
577- Duration : time .Duration (ch .Duration ) * time .Second ,
578- TrackNumber : ch .Track ,
579- DiscNumber : ch .DiscNumber ,
580- Genres : genres ,
581- ArtistIDs : artistIDs ,
582- ArtistNames : artistNames ,
583- ComposerIDs : composerIDs ,
584- ComposerNames : composers ,
585- Album : ch .Album ,
586- AlbumID : ch .AlbumID ,
587- Year : ch .Year ,
588- Rating : ch .UserRating ,
589- Favorite : ! ch .Starred .IsZero (),
590- PlayCount : int (ch .PlayCount ),
591- LastPlayed : ch .Played ,
592- FilePath : ch .Path ,
593- Size : ch .Size ,
594- BitRate : ch .BitRate ,
595- ContentType : ch .ContentType ,
596- Comment : ch .Comment ,
597- BPM : ch .BPM ,
598- ReplayGain : rGain ,
599- SampleRate : ch .SamplingRate ,
600- BitDepth : ch .BitDepth ,
601- Channels : ch .ChannelCount ,
582+ ID : ch .ID ,
583+ CoverArtID : ch .CoverArt ,
584+ ParentID : ch .Parent ,
585+ Title : ch .Title ,
586+ Duration : time .Duration (ch .Duration ) * time .Second ,
587+ TrackNumber : ch .Track ,
588+ DiscNumber : ch .DiscNumber ,
589+ Genres : genres ,
590+ ArtistIDs : artistIDs ,
591+ ArtistNames : artistNames ,
592+ AlbumArtistIDs : albumArtistIDs ,
593+ AlbumArtistNames : albumArtistNames ,
594+ ComposerIDs : composerIDs ,
595+ ComposerNames : composers ,
596+ Album : ch .Album ,
597+ AlbumID : ch .AlbumID ,
598+ Year : ch .Year ,
599+ Rating : ch .UserRating ,
600+ Favorite : ! ch .Starred .IsZero (),
601+ PlayCount : int (ch .PlayCount ),
602+ LastPlayed : ch .Played ,
603+ DateAdded : ch .Created ,
604+ FilePath : ch .Path ,
605+ Size : ch .Size ,
606+ BitRate : ch .BitRate ,
607+ ContentType : ch .ContentType ,
608+ Extension : ch .Suffix ,
609+ Comment : ch .Comment ,
610+ BPM : ch .BPM ,
611+ ReplayGain : rGain ,
612+ SampleRate : ch .SamplingRate ,
613+ BitDepth : ch .BitDepth ,
614+ Channels : ch .ChannelCount ,
602615 }
603616}
604617
0 commit comments