From 03a665861dba80cf6c7f85d1070365a28543e667 Mon Sep 17 00:00:00 2001 From: Vincent Ducamps Date: Mon, 11 Jan 2021 22:30:14 +0100 Subject: [PATCH] reformating subsonicupdate.py Co-authored-by: Jef LeCompte --- beetsplug/subsonicupdate.py | 12 +++++------- test/test_subsonicupdate.py | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/beetsplug/subsonicupdate.py b/beetsplug/subsonicupdate.py index cd1905c02..91f5bb997 100644 --- a/beetsplug/subsonicupdate.py +++ b/beetsplug/subsonicupdate.py @@ -34,7 +34,7 @@ from beets import config from beets.plugins import BeetsPlugin __author__ = 'https://github.com/maffo999' -authtokenversion = '1.12' +AUTH_TOKEN_VERSION = '1.12' class SubsonicUpdate(BeetsPlugin): @@ -47,14 +47,12 @@ class SubsonicUpdate(BeetsPlugin): 'url': 'http://localhost:4040', }) self.version = self.__get_version() - if self.version > authtokenversion: - self._log.info( - u'use token authent method') + if self.version > AUTH_TOKEN_VERSION: self.auth = "token" else: self.auth = "password" - self._log.info( - u'use password authent method') + self._log.info( + u"using '{}' authentication method".format(self.auth)) config['subsonic']['pass'].redact = True self.register_listener('import', self.start_scan) @@ -77,7 +75,7 @@ class SubsonicUpdate(BeetsPlugin): @staticmethod def __format_url(endpoint): - """Get the Subsonic URL to trigger a endpoint put in paramater. + """Get the Subsonic URL to trigger the given endpoint. Uses either the url config option or the deprecated host, port, and context_path config options together. diff --git a/test/test_subsonicupdate.py b/test/test_subsonicupdate.py index 0a4fdd512..dd254d593 100644 --- a/test/test_subsonicupdate.py +++ b/test/test_subsonicupdate.py @@ -49,7 +49,7 @@ class SubsonicPluginTest(_common.TestCase, TestHelper): PING_BODY = ''' { "subsonic-response": { - "status": "failled", + "status": "failed", "version": "1.15.0" } }