mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 12:16:12 +00:00
Try to fix username error
This commit is contained in:
parent
a614ff96cd
commit
f6e5713dfe
2 changed files with 9 additions and 9 deletions
|
@ -163,14 +163,15 @@ class Service(object):
|
||||||
# Start up events
|
# Start up events
|
||||||
self.warn_auth = True
|
self.warn_auth = True
|
||||||
|
|
||||||
if settings('connectMsg') == "true":
|
username = self.userclient_thread.get_username()
|
||||||
|
if settings('connectMsg') == "true" and username:
|
||||||
# Get additional users
|
# Get additional users
|
||||||
add_users = ", ".join(settings('additionalUsers').split(','))
|
add_users = ", ".join(settings('additionalUsers').split(','))
|
||||||
|
|
||||||
dialog(type_="notification",
|
dialog(type_="notification",
|
||||||
heading="{emby}",
|
heading="{emby}",
|
||||||
message=("%s %s %s"
|
message=("%s %s %s"
|
||||||
% (lang(33000), self.userclient_thread.get_username().decode('utf-8'),
|
% (lang(33000), username.decode('utf-8'),
|
||||||
add_users.decode('utf-8'))),
|
add_users.decode('utf-8'))),
|
||||||
icon="{emby}",
|
icon="{emby}",
|
||||||
time=2000,
|
time=2000,
|
||||||
|
|
|
@ -144,8 +144,10 @@ class UserClient(threading.Thread):
|
||||||
|
|
||||||
def _set_user_server(self):
|
def _set_user_server(self):
|
||||||
|
|
||||||
self._user = self.download("{server}/emby/Users/{UserId}?format=json")
|
user = self.download("{server}/emby/Users/{UserId}?format=json")
|
||||||
settings('username', value=self._user['Name'])
|
settings('username', value=user['Name'])
|
||||||
|
self._user = user
|
||||||
|
|
||||||
if "PrimaryImageTag" in self._user:
|
if "PrimaryImageTag" in self._user:
|
||||||
window('EmbyUserImage',
|
window('EmbyUserImage',
|
||||||
value=artwork.Artwork().get_user_artwork(self._user['Id'], 'Primary'))
|
value=artwork.Artwork().get_user_artwork(self._user['Id'], 'Primary'))
|
||||||
|
@ -224,11 +226,8 @@ class UserClient(threading.Thread):
|
||||||
# Token is not longer valid
|
# Token is not longer valid
|
||||||
raise
|
raise
|
||||||
|
|
||||||
try: # verify user access
|
# verify user access
|
||||||
self._set_access()
|
self._set_access()
|
||||||
except Warning: # We don't need to raise any exceptions
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Start downloadutils.py session
|
# Start downloadutils.py session
|
||||||
doutils.start_session()
|
doutils.start_session()
|
||||||
# Set _user and _server
|
# Set _user and _server
|
||||||
|
|
Loading…
Reference in a new issue