🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Fix DiscTitle OpenSubsonic compatibility. Closes #2929
Deluan4865d04ec625
diff --git a/server/subsonic/responses/.snapshots/Responses AlbumWithSongsID3 with data should match .JSON b/server/subsonic/responses/.snapshots/Responses AlbumWithSongsID3 with data should match .JSONindex 24bb69c42..c5f1ea141 100644--- a/server/subsonic/responses/.snapshots/Responses AlbumWithSongsID3 with data should match .JSON+++ b/server/subsonic/responses/.snapshots/Responses AlbumWithSongsID3 with data should match .JSON@@ -29,6 +29,10 @@{"disc": 2,"title": "disc 2"+ },+ {+ "disc": 3,+ "title": ""}],"originalReleaseDate": {diff --git a/server/subsonic/responses/.snapshots/Responses AlbumWithSongsID3 with data should match .XML b/server/subsonic/responses/.snapshots/Responses AlbumWithSongsID3 with data should match .XMLindex a1aed3fb0..f7bcf1f13 100644--- a/server/subsonic/responses/.snapshots/Responses AlbumWithSongsID3 with data should match .XML+++ b/server/subsonic/responses/.snapshots/Responses AlbumWithSongsID3 with data should match .XML@@ -4,6 +4,7 @@<genres name="progressive"></genres><discTitles disc="1" title="disc 1"></discTitles><discTitles disc="2" title="disc 2"></discTitles>+ <discTitles disc="3" title=""></discTitles><originalReleaseDate year="1994" month="2" day="4"></originalReleaseDate><releaseDate year="2000" month="5" day="10"></releaseDate><song id="1" isDir="true" title="title" album="album" artist="artist" track="1" year="1985" genre="Rock" coverArt="1" size="8421341" contentType="audio/flac" suffix="flac" starred="2016-03-02T20:30:00Z" transcodedContentType="audio/mpeg" transcodedSuffix="mp3" duration="146" bitRate="320" isVideo="false" bpm="127" comment="a comment" sortName="sorted song" mediaType="song" musicBrainzId="4321">diff --git a/server/subsonic/responses/responses.go b/server/subsonic/responses/responses.goindex 2416c74d8..3e6267c31 100644--- a/server/subsonic/responses/responses.go+++ b/server/subsonic/responses/responses.go@@ -501,8 +501,8 @@ type ReplayGain struct {}type DiscTitle struct {- Disc int `xml:"disc,attr,omitempty" json:"disc,omitempty"`- Title string `xml:"title,attr,omitempty" json:"title,omitempty"`+ Disc int `xml:"disc,attr" json:"disc"`+ Title string `xml:"title,attr" json:"title"`}type DiscTitles []DiscTitlediff --git a/server/subsonic/responses/responses_test.go b/server/subsonic/responses/responses_test.goindex e4e429c98..b4af4a0ec 100644--- a/server/subsonic/responses/responses_test.go+++ b/server/subsonic/responses/responses_test.go@@ -176,7 +176,7 @@ var _ = Describe("Responses", func() {Id: "1", Name: "album", Artist: "artist", Genre: "rock",Genres: []ItemGenre{{Name: "rock"}, {Name: "progressive"}},MusicBrainzId: "1234", IsCompilation: true, SortName: "sorted album",- DiscTitles: DiscTitles{{Disc: 1, Title: "disc 1"}, {Disc: 2, Title: "disc 2"}},+ DiscTitles: DiscTitles{{Disc: 1, Title: "disc 1"}, {Disc: 2, Title: "disc 2"}, {Disc: 3}},OriginalReleaseDate: ItemDate{Year: 1994, Month: 2, Day: 4},ReleaseDate: ItemDate{Year: 2000, Month: 5, Day: 10},}