Remember sync position for manual triggers

Allow to resume sync on restart for manual user triggers (update, repair). Automatically refresh boxsets if movie library is selected.

use waitForAbort and emby_should_stop prop to terminate threads
This commit is contained in:
angelblue05 2018-09-22 02:52:14 -05:00
parent 00ee891952
commit 11f771ade2
9 changed files with 54 additions and 28 deletions

View file

@ -46,7 +46,7 @@ class HTTP(object):
return
try:
LOG.warn("Closing session %s", id(self.session))
LOG.warn("--<[ session/%s ]", id(self.session))
self.session.close()
except Exception as error:
LOG.warn("The requests session could not be terminated: %s", error)

View file

@ -7,6 +7,8 @@ import logging
import threading
import time
import xbmc
from ..resources import websocket
##################################################################################################
@ -46,6 +48,7 @@ class WSClient(threading.Thread):
def run(self):
monitor = xbmc.Monitor()
token = self.client['config/auth.token']
device_id = self.client['config/app.device_id']
server = self.client['config/auth.server']
@ -63,8 +66,8 @@ class WSClient(threading.Thread):
self.wsc.run_forever(ping_interval=10)
if not self.stop:
time.sleep(5)
if not self.stop and monitor.waitForAbort(5):
break
LOG.info("---<[ websocket ]")