Merge branch 'master' into develop

This commit is contained in:
Eliot Berriot 2019-06-28 10:38:52 +02:00
commit 8f261f96e9
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
26 changed files with 111 additions and 33 deletions

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "0.19.0"
__version__ = "0.19.1"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num

View file

@ -247,10 +247,6 @@ class SubsonicViewSet(viewsets.GenericViewSet):
if not upload:
return response.Response(status=404)
format = data.get("format", "raw")
if format == "raw":
format = None
max_bitrate = data.get("maxBitRate")
try:
max_bitrate = min(max(int(max_bitrate), 0), 320) or None
@ -259,6 +255,16 @@ class SubsonicViewSet(viewsets.GenericViewSet):
if max_bitrate:
max_bitrate = max_bitrate * 1000
format = data.get("format", "raw") 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
# that don't send the format parameter, such as DSub.
format = settings.SUBSONIC_DEFAULT_TRANSCODING_FORMAT
elif format == "raw":
format = None
return music_views.handle_serve(
upload=upload,
user=request.user,