diff --git a/resources/lib/service_entry.py b/resources/lib/service_entry.py index 191820a2..aee100fb 100644 --- a/resources/lib/service_entry.py +++ b/resources/lib/service_entry.py @@ -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, diff --git a/resources/lib/userclient.py b/resources/lib/userclient.py index 5c103aa9..33405e87 100644 --- a/resources/lib/userclient.py +++ b/resources/lib/userclient.py @@ -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