allow maxBitRate=0 as some clients set it as the default
Gitea/pysonic/pipeline/head Something is wrong with the build of this commit
Details
Gitea/pysonic/pipeline/head Something is wrong with the build of this commit
Details
This commit is contained in:
parent
092c833c4f
commit
afbf71aa08
|
@ -189,8 +189,9 @@ class PysonicSubsonicApi(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
def stream_view(self, id, maxBitRate="256", **kwargs):
|
def stream_view(self, id, maxBitRate="256", **kwargs):
|
||||||
maxBitRate = int(maxBitRate)
|
maxBitRate = int(maxBitRate) or 256
|
||||||
assert maxBitRate >= 32 and maxBitRate <= 320
|
if maxBitRate < 32 or maxBitRate > 320:
|
||||||
|
raise cherrypy.HTTPError(400, message=f"invalid maxBitRate: {maxBitRate}. Must be between 32 and 320.")
|
||||||
song = self.db.get_songs(id=int(id))[0]
|
song = self.db.get_songs(id=int(id))[0]
|
||||||
fpath = os.path.join(song["root"], song["file"])
|
fpath = os.path.join(song["root"], song["file"])
|
||||||
media_bitrate = song.get("bitrate") / 1024 if song.get("bitrate") else 320
|
media_bitrate = song.get("bitrate") / 1024 if song.get("bitrate") else 320
|
||||||
|
|
Loading…
Reference in New Issue