# HG changeset patch # User Reed Wade # Date 1595321220 -7200 # Tue Jul 21 10:47:00 2020 +0200 # Node ID a6b0672fa9a6e8b8919b3c14302534212c8d972a # Parent 01647b78ca0c61b4304bbf8558d3ff394292e3b1 handle format diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ ``` [multisonic] providers = - banalisation: https://mr_banal:azerty@music.banalserver.com?max_bit_rate=320 + banalisation: https://mr_banal:azerty@music.banalserver.com?max_bit_rate=320&format=mp3 ``` ``` diff --git a/mopidy_multisonic/backend.py b/mopidy_multisonic/backend.py --- a/mopidy_multisonic/backend.py +++ b/mopidy_multisonic/backend.py @@ -22,7 +22,7 @@ return options def load_http_client_config(provider): - match = re.match(r'^([^:]+):(?: )?([^:]+)://([^:]+):([^@]+)@([^?]+)(\?([^=]+=[^&]+)+)?', provider) + match = re.match(r'^([^:]+):(?: )?([^:]+)://([^:]+):([^@]+)@([^?]+)(\?(.+))?', provider) name=match.group(1) protocol=match.group(2) @@ -38,7 +38,8 @@ url=protocol + "://" + url, username=username, password=password, - max_bit_rate=options.get("max_bit_rate") + max_bit_rate=options.get("max_bit_rate"), + format=options.get("format") ) def load_http_client_configs(config): diff --git a/mopidy_multisonic/httpclient.py b/mopidy_multisonic/httpclient.py --- a/mopidy_multisonic/httpclient.py +++ b/mopidy_multisonic/httpclient.py @@ -11,6 +11,7 @@ 'username', 'password', 'max_bit_rate', + 'format', ] ) @@ -93,6 +94,8 @@ if client_config.max_bit_rate: params["maxBitRate"] = client_config.max_bit_rate, + if client_config.format: + params["format"] = client_config.format, return get_request(client_config, "/rest/stream", params)