Skip to content
Snippets Groups Projects
Verified Commit 5715773f authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Fix #765: Include disc number in Subsonic responses

parent 12113c6e
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,7 @@ def get_track_data(album, track, upload): ...@@ -70,6 +70,7 @@ def get_track_data(album, track, upload):
"album": album.title, "album": album.title,
"artist": album.artist.name, "artist": album.artist.name,
"track": track.position or 1, "track": track.position or 1,
"discNumber": track.disc_number or 1,
"contentType": upload.mimetype, "contentType": upload.mimetype,
"suffix": upload.extension or "", "suffix": upload.extension or "",
"duration": upload.duration or 0, "duration": upload.duration or 0,
......
...@@ -64,7 +64,7 @@ def test_get_artist_serializer(factories): ...@@ -64,7 +64,7 @@ def test_get_artist_serializer(factories):
def test_get_album_serializer(factories): def test_get_album_serializer(factories):
artist = factories["music.Artist"]() artist = factories["music.Artist"]()
album = factories["music.Album"](artist=artist) album = factories["music.Album"](artist=artist)
track = factories["music.Track"](album=album) track = factories["music.Track"](album=album, disc_number=42)
upload = factories["music.Upload"](track=track, bitrate=42000, duration=43, size=44) upload = factories["music.Upload"](track=track, bitrate=42000, duration=43, size=44)
expected = { expected = {
...@@ -85,6 +85,7 @@ def test_get_album_serializer(factories): ...@@ -85,6 +85,7 @@ def test_get_album_serializer(factories):
"album": album.title, "album": album.title,
"artist": artist.name, "artist": artist.name,
"track": track.position, "track": track.position,
"discNumber": track.disc_number,
"year": track.album.release_date.year, "year": track.album.release_date.year,
"contentType": upload.mimetype, "contentType": upload.mimetype,
"suffix": upload.extension or "", "suffix": upload.extension or "",
......
Include disc number in Subsonic responses (#765)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment