remove service check as it is no longer needed
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="plugin.video.embycon"
|
||||
name="EmbyCon"
|
||||
version="1.3.24"
|
||||
version="1.3.25"
|
||||
provider-name="Team B">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.24.0"/>
|
||||
|
||||
@@ -63,7 +63,6 @@ def mainEntryPoint():
|
||||
except:
|
||||
params = {}
|
||||
|
||||
checkService()
|
||||
home_window = HomeWindow()
|
||||
|
||||
if (len(params) == 0):
|
||||
@@ -1067,28 +1066,6 @@ def showParentContent(pluginName, handle, params):
|
||||
log.debug("showParentContent Content Url : " + str(contentUrl))
|
||||
getContent(contentUrl, params)
|
||||
|
||||
def checkService():
|
||||
home_window = HomeWindow()
|
||||
time_stamp = home_window.getProperty("Service_Timestamp")
|
||||
loops = 0
|
||||
while not time_stamp and not xbmc.Monitor().abortRequested():
|
||||
loops = loops + 1
|
||||
if loops == 100:
|
||||
log.error("EmbyCon Service Not Running, no time stamp, exiting")
|
||||
xbmcgui.Dialog().ok(i18n('error'), i18n('service_not_running'), i18n('restart_kodi'))
|
||||
sys.exit()
|
||||
xbmc.sleep(200)
|
||||
time_stamp = home_window.getProperty("Service_Timestamp")
|
||||
|
||||
log.debug("EmbyCon Service Timestamp: " + time_stamp)
|
||||
log.debug("EmbyCon Current Timestamp: " + str(int(time.time())))
|
||||
|
||||
if ((int(time_stamp) + 240) < int(time.time())):
|
||||
log.error("EmbyCon Service Not Running, time stamp to old, exiting")
|
||||
xbmcgui.Dialog().ok(i18n('error'), i18n('service_not_running'), i18n('restart_kodi'))
|
||||
sys.exit()
|
||||
|
||||
|
||||
def search(handle, params):
|
||||
log.debug('search Called: ' + str(params))
|
||||
item_type = params.get('item_type')
|
||||
|
||||
27
service.py
27
service.py
@@ -6,6 +6,7 @@ import xbmcaddon
|
||||
import xbmcgui
|
||||
import time
|
||||
import json
|
||||
import traceback
|
||||
|
||||
from resources.lib.downloadutils import DownloadUtils
|
||||
from resources.lib.simple_logging import SimpleLogging
|
||||
@@ -297,28 +298,24 @@ home_window = HomeWindow()
|
||||
|
||||
while not xbmc.abortRequested:
|
||||
|
||||
if xbmc.Player().isPlaying():
|
||||
|
||||
try:
|
||||
try:
|
||||
if xbmc.Player().isPlaying():
|
||||
if (time.time() - last_progress_update) > 10:
|
||||
last_progress_update = time.time()
|
||||
sendProgress()
|
||||
else:
|
||||
play_data = home_window.getProperty("play_item_message")
|
||||
if play_data:
|
||||
home_window.clearProperty("play_item_message")
|
||||
play_info = json.loads(play_data)
|
||||
playFile(play_info)
|
||||
except Exception as error:
|
||||
log.error("Exception in Playback Monitor : " + str(error))
|
||||
log.error(traceback.format_exc())
|
||||
|
||||
except Exception as error:
|
||||
log.error("Exception in Playback Monitor : " + str(error))
|
||||
|
||||
else:
|
||||
play_data = home_window.getProperty("play_item_message")
|
||||
if play_data:
|
||||
home_window.clearProperty("play_item_message")
|
||||
play_info = json.loads(play_data)
|
||||
playFile(play_info)
|
||||
|
||||
home_window.setProperty("Service_Timestamp", str(int(time.time())))
|
||||
xbmc.sleep(1000)
|
||||
|
||||
# clear user and token when loggin off
|
||||
home_window.clearProperty("Service_Timestamp")
|
||||
home_window.clearProperty("userid")
|
||||
home_window.clearProperty("AccessToken")
|
||||
home_window.clearProperty("Params")
|
||||
|
||||
Reference in New Issue
Block a user