mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-06-17 13:46:14 +00:00
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:
parent
a3b500061a
commit
354f0905f6
3 changed files with 83 additions and 48 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue