Support Parental control - access schedule

I had to reorganize the service.py loop a bit for this to work.
Logically the top level inside the while loop should be if the user is
authenticated.
This commit is contained in:
angelblue05 2015-05-12 02:34:03 -05:00
parent a3b500061a
commit 354f0905f6
3 changed files with 83 additions and 48 deletions

View file

@ -265,8 +265,16 @@ class DownloadUtils():
if r.status_code == 401:
# Unauthorized
status = WINDOW.getProperty("Server_status")
if (status == "401") or (status == "Auth"):
if r.headers['X-Application-Error-Code'] == "ParentalControl":
# Parental control - access restricted
WINDOW.setProperty("Server_status", "restricted")
xbmcgui.Dialog().notification("Emby server", "Access restricted.", xbmcgui.NOTIFICATION_ERROR)
return False
elif (status == "401") or (status == "Auth"):
pass
else:
# Tell UserClient token has been revoked.
WINDOW.setProperty("Server_status", "401")