add exception and notification when not logged in

This commit is contained in:
sfaulds 2016-11-17 07:07:49 +11:00
parent 2dd0a9206d
commit 5b86aa1ca9
3 changed files with 10 additions and 2 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.emby" <addon id="plugin.video.emby"
name="Emby" name="Emby"
version="2.3.16" version="2.3.17"
provider-name="Emby.media"> provider-name="Emby.media">
<requires> <requires>
<import addon="xbmc.python" version="2.19.0"/> <import addon="xbmc.python" version="2.19.0"/>

View file

@ -233,5 +233,5 @@ def db_reset():
dialog.ok(heading=language(29999), line1=language(33088)) dialog.ok(heading=language(29999), line1=language(33088))
xbmc.executebuiltin('RestartApp') xbmc.executebuiltin('RestartApp')
return xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, xbmcgui.ListItem()) #return xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, xbmcgui.ListItem())

View file

@ -225,6 +225,14 @@ class DownloadUtils(object):
'headers': self.get_header(server_id, authenticate) 'headers': self.get_header(server_id, authenticate)
}) })
if not server['Server'] or not server['UserId']:
log.error("Server or UserId not set, not logged in, returning None")
xbmcgui.Dialog().notification(heading=lang(29999),
message="Not Logged In",
icon=xbmcgui.NOTIFICATION_ERROR,
time=5000)
raise internal_exceptions.ExceptionWrapper("Not Logged In")
# Replace for the real values # Replace for the real values
url = url.replace("{server}", server['Server']) url = url.replace("{server}", server['Server'])
url = url.replace("{UserId}", server['UserId']) url = url.replace("{UserId}", server['UserId'])