diff --git a/beetsplug/subsonicupdate.py b/beetsplug/subsonicupdate.py index 38ab2b0ba..c284daa62 100644 --- a/beetsplug/subsonicupdate.py +++ b/beetsplug/subsonicupdate.py @@ -20,7 +20,7 @@ a "subsonic" section like the following: url: https://mydomain.com:443/subsonic user: username pass: password - auth: enc or token + auth: enc or plain """ from __future__ import division, absolute_import, print_function @@ -95,7 +95,7 @@ class SubsonicUpdate(BeetsPlugin): def start_scan(self): user = config['subsonic']['user'].as_str() url = self.__format_url() - if config['subsonic']['user'] == 'token': + if config['subsonic']['auth'] == 'token': salt, token = self.__create_token() payload = { 'u': user, @@ -119,6 +119,7 @@ class SubsonicUpdate(BeetsPlugin): try: response = requests.get(url, params=payload) json = response.json() + if response.status_code == 200 and \ json['subsonic-response']['status'] == "ok": count = json['subsonic-response']['scanStatus']['count'] diff --git a/docs/plugins/subsonicupdate.rst b/docs/plugins/subsonicupdate.rst index 710d21f2c..a8e1e537f 100644 --- a/docs/plugins/subsonicupdate.rst +++ b/docs/plugins/subsonicupdate.rst @@ -30,5 +30,6 @@ The available options under the ``subsonic:`` section are: - **url**: The Subsonic server resource. Default: ``http://localhost:4040`` - **user**: The Subsonic user. Default: ``admin`` +- **auth**: authentification method token or plain password - **pass**: The Subsonic user password. (This may either be a clear-text password or hex-encoded with the prefix ``enc:``.) Default: ``admin``