add exception and notification when not logged in

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

View file

@ -225,6 +225,14 @@ class DownloadUtils(object):
'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
url = url.replace("{server}", server['Server'])
url = url.replace("{UserId}", server['UserId'])