Fix progress report

Silent RefreshProgress in websocket
This commit is contained in:
angelblue05 2018-11-04 16:36:32 -06:00
parent 05483c7406
commit d5f9b76020
2 changed files with 10 additions and 4 deletions

View file

@ -82,6 +82,11 @@ class WSClient(threading.Thread):
message = json.loads(message)
data = message.get('Data', {})
if message['MessageType'] in ('RefreshProgress'):
LOG.debug("Ignoring %s", message)
return
if not self.client['config/app.default']:
data['ServerId'] = self.client['auth/server-id']

View file

@ -38,7 +38,7 @@ class Service(xbmc.Monitor):
monitor = None
play_event = None
warn = True
settings = {'last_progress': datetime.today()}
settings = {'last_progress': datetime.today(), 'last_progress_report': datetime.today()}
def __init__(self):
@ -109,12 +109,13 @@ class Service(xbmc.Monitor):
difference = datetime.today() - self.settings['last_progress']
if difference.seconds > 10:
self.settings['last_progress'] = datetime.today()
update = difference.seconds > 250
update = (datetime.today() - self.settings['last_progress_report']).seconds > 250
event('ReportProgressRequested', {'Report': update})
if update:
self.settings['last_progress'] = datetime.today()
self.settings['last_progress_report'] = datetime.today()
if window('emby.restart.bool'):
window('emby.restart', clear=True)