mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-06-10 02:06:13 +00:00
Moving the watchdog to service.py
This commit is contained in:
parent
e685c99b5a
commit
0a948d59f6
2 changed files with 34 additions and 33 deletions
|
@ -21,7 +21,6 @@ from API import API
|
|||
|
||||
##### Play items via plugin://plugin.video.emby/ #####
|
||||
def doPlayback(id):
|
||||
checkService()
|
||||
url = "{server}/mediabrowser/Users/{UserId}/Items/%s?format=json&ImageTypeLimit=1" % id
|
||||
result = DownloadUtils().downloadUrl(url)
|
||||
item = PlaybackUtils().PLAY(result, setup="default")
|
||||
|
@ -483,31 +482,3 @@ def doMainListing():
|
|||
addDirectoryItem("Perform local database reset (full resync)", "plugin://plugin.video.emby/?mode=reset")
|
||||
|
||||
xbmcplugin.endOfDirectory(int(sys.argv[1]))
|
||||
|
||||
def checkService():
|
||||
|
||||
timeStamp = xbmcgui.Window(10000).getProperty("Emby_Service_Timestamp")
|
||||
loops = 0
|
||||
monitor = xbmc.Monitor()
|
||||
while(timeStamp == ""):
|
||||
timeStamp = xbmcgui.Window(10000).getProperty("Emby_Service_Timestamp")
|
||||
loops = loops + 1
|
||||
if(loops == 5):
|
||||
xbmc.log("Emby Service Not Running, no time stamp, exiting")
|
||||
addon = xbmcaddon.Addon(id='plugin.video.emby')
|
||||
language = addon.getLocalizedString
|
||||
xbmcgui.Dialog().ok(language(30135), language(30136), language(30137))
|
||||
sys.exit()
|
||||
if monitor.waitForAbort(1):
|
||||
# Abort was requested while waiting. We should exit
|
||||
return
|
||||
|
||||
xbmc.log("Emby Service Timestamp: " + timeStamp)
|
||||
xbmc.log("Emby Current Timestamp: " + str(int(time.time())))
|
||||
|
||||
if((int(timeStamp) + 30) < int(time.time())):
|
||||
xbmc.log("Emby Service Not Running, time stamp to old, exiting")
|
||||
addon = xbmcaddon.Addon(id='plugin.video.emby')
|
||||
language = addon.getLocalizedString
|
||||
xbmcgui.Dialog().ok(language(30135), language(30136), language(30137))
|
||||
sys.exit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue