mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
reformating subsonicupdate.py
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
This commit is contained in:
parent
b37c55bc0b
commit
03a665861d
2 changed files with 6 additions and 8 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class SubsonicPluginTest(_common.TestCase, TestHelper):
|
|||
PING_BODY = '''
|
||||
{
|
||||
"subsonic-response": {
|
||||
"status": "failled",
|
||||
"status": "failed",
|
||||
"version": "1.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue