Fix unauthorized behavior

Reprompt user with login
This commit is contained in:
angelblue05 2018-09-14 21:19:41 -05:00
parent 5ab2a7db5c
commit bb933604b0
2 changed files with 13 additions and 1 deletions

View file

@ -1,6 +1,6 @@
get_item = """ SELECT kodi_id, kodi_fileid, kodi_pathid, parent_id, media_type, get_item = """ SELECT kodi_id, kodi_fileid, kodi_pathid, parent_id, media_type,
emby_type, media_folder emby_type, media_folder, emby_parent_id
FROM emby FROM emby
WHERE emby_id = ? WHERE emby_id = ?
""" """

View file

@ -46,6 +46,7 @@ class Service(xbmc.Monitor):
self.settings['profile'] = xbmc.translatePath('special://profile') self.settings['profile'] = xbmc.translatePath('special://profile')
self.settings['mode'] = settings('useDirectPaths') self.settings['mode'] = settings('useDirectPaths')
self.settings['log_level'] = settings('logLevel') or "1" self.settings['log_level'] = settings('logLevel') or "1"
self.settings['auth_check'] = True
self.settings['enable_context'] = settings('enableContext.bool') self.settings['enable_context'] = settings('enableContext.bool')
self.settings['enable_context_transcode'] = settings('enableContextTranscode.bool') self.settings['enable_context_transcode'] = settings('enableContextTranscode.bool')
self.settings['kodi_companion'] = settings('kodiCompanion.bool') self.settings['kodi_companion'] = settings('kodiCompanion.bool')
@ -199,6 +200,7 @@ class Service(xbmc.Monitor):
if data['ServerId'] is None: if data['ServerId'] is None:
window('emby_online.bool', True) window('emby_online.bool', True)
self.settings['auth_check'] = True
self.warn = True self.warn = True
if self.library_thread is None: if self.library_thread is None:
@ -224,6 +226,16 @@ class Service(xbmc.Monitor):
elif method == 'Unauthorized': elif method == 'Unauthorized':
dialog("notification", heading="{emby}", message=_(33147) if data['ServerId'] is None else _(33148), icon=xbmcgui.NOTIFICATION_ERROR) dialog("notification", heading="{emby}", message=_(33147) if data['ServerId'] is None else _(33148), icon=xbmcgui.NOTIFICATION_ERROR)
if data.get('ServerId') is None and self.settings['auth_check']:
self.settings['auth_check'] = False
self.stop_default()
if self.waitForAbort(5):
return
self.start_default()
elif method == 'ServerRestarting': elif method == 'ServerRestarting':
if data.get('ServerId'): if data.get('ServerId'):
return return