Try to fix username error

This commit is contained in:
angelblue05 2016-10-20 02:39:37 -05:00
parent a614ff96cd
commit f6e5713dfe
2 changed files with 9 additions and 9 deletions

View file

@ -163,14 +163,15 @@ class Service(object):
# Start up events
self.warn_auth = True
if settings('connectMsg') == "true":
username = self.userclient_thread.get_username()
if settings('connectMsg') == "true" and username:
# Get additional users
add_users = ", ".join(settings('additionalUsers').split(','))
dialog(type_="notification",
heading="{emby}",
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'))),
icon="{emby}",
time=2000,

View file

@ -144,8 +144,10 @@ class UserClient(threading.Thread):
def _set_user_server(self):
self._user = self.download("{server}/emby/Users/{UserId}?format=json")
settings('username', value=self._user['Name'])
user = self.download("{server}/emby/Users/{UserId}?format=json")
settings('username', value=user['Name'])
self._user = user
if "PrimaryImageTag" in self._user:
window('EmbyUserImage',
value=artwork.Artwork().get_user_artwork(self._user['Id'], 'Primary'))
@ -224,11 +226,8 @@ class UserClient(threading.Thread):
# Token is not longer valid
raise
try: # verify user access
self._set_access()
except Warning: # We don't need to raise any exceptions
pass
# verify user access
self._set_access()
# Start downloadutils.py session
doutils.start_session()
# Set _user and _server