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

Merge branch '867-subsonic-default-transcoding-again' into 'master'

Resolve "Provide a default format when transcoding via Subsonic"

See merge request funkwhale/funkwhale!819
parents 5e183331 38ab0519
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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,
......
Fixed remaining transcoding issue with Subsonic API (#867)
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