Skip to content

Commit efbd58c

Browse files
committed
embyupdate: fix bug that config for password and api is needed
even if it only used api key it needed the password key. this is fixed now.
1 parent d389ac1 commit efbd58c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

beetsplug/embyupdate.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
host: localhost
77
port: 8096
88
username: user
9+
apikey: apikey
910
password: password
1011
"""
1112
from __future__ import division, absolute_import, print_function
@@ -150,7 +151,9 @@ def __init__(self):
150151
# Adding defaults.
151152
config['emby'].add({
152153
u'host': u'http://localhost',
153-
u'port': 8096
154+
u'port': 8096,
155+
u'apikey': None,
156+
u'password': None
154157
})
155158

156159
self.register_listener('database_change', self.listen_for_db_change)
@@ -171,6 +174,11 @@ def update(self, lib):
171174
password = config['emby']['password'].get()
172175
token = config['emby']['apikey'].get()
173176

177+
# Check if at least a apikey or password is given.
178+
if not any([password, token]):
179+
self._log.warning(u'Provide at least Emby password or apikey.')
180+
return
181+
174182
# Get user information from the Emby API.
175183
user = get_user(host, port, username)
176184
if not user:

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Fixes:
4444
:bug:`2302`
4545
* :doc:`/plugins/lyrics`: The plugin now reports a beets-specific User-Agent
4646
header when requesting lyrics. :bug:`2357`
47+
* :doc:`/plugins/embyupdate`: Fix a bug that apikey and password is needed in config.
4748

4849
For plugin developers: new importer prompt choices (see :ref:`append_prompt_choices`), you can now provide new candidates for the user to consider.
4950

0 commit comments

Comments
 (0)