Fix #867: Fixed remaining transcoding issue with Subsonic API

environments/review-front-brok-oyrjvg/deployments/2100
Eliot Berriot 2019-07-03 11:35:34 +02:00
rodzic 5e18333135
commit 38ab05195b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
3 zmienionych plików z 7 dodań i 5 usunięć

Wyświetl plik

@ -256,7 +256,7 @@ class SubsonicViewSet(viewsets.GenericViewSet):
if max_bitrate:
max_bitrate = max_bitrate * 1000
format = data.get("format", "raw") or None
format = data.get("format") or None
if max_bitrate and not format:
# specific bitrate requested, but no format specified
# so we use a default one, cf #867. This helps with clients

Wyświetl plik

@ -288,15 +288,16 @@ def test_stream_transcode(
mocker,
settings,
):
upload = factories["music.Upload"](playable=True)
params = {"id": upload.track.pk, "maxBitRate": max_bitrate}
if format:
params["format"] = format
settings.SUBSONIC_DEFAULT_TRANSCODING_FORMAT = default_transcoding_format
url = reverse("api:subsonic-stream")
mocked_serve = mocker.patch.object(
music_views, "handle_serve", return_value=Response()
)
upload = factories["music.Upload"](playable=True)
response = logged_in_api_client.get(
url, {"id": upload.track.pk, "maxBitRate": max_bitrate, "format": format}
)
response = logged_in_api_client.get(url, params)
mocked_serve.assert_called_once_with(
upload=upload,

Wyświetl plik

@ -0,0 +1 @@
Fixed remaining transcoding issue with Subsonic API (#867)