mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Fix progress report
Silent RefreshProgress in websocket
This commit is contained in:
parent
05483c7406
commit
d5f9b76020
2 changed files with 10 additions and 4 deletions
|
@ -82,6 +82,11 @@ class WSClient(threading.Thread):
|
||||||
message = json.loads(message)
|
message = json.loads(message)
|
||||||
data = message.get('Data', {})
|
data = message.get('Data', {})
|
||||||
|
|
||||||
|
if message['MessageType'] in ('RefreshProgress'):
|
||||||
|
LOG.debug("Ignoring %s", message)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
if not self.client['config/app.default']:
|
if not self.client['config/app.default']:
|
||||||
data['ServerId'] = self.client['auth/server-id']
|
data['ServerId'] = self.client['auth/server-id']
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Service(xbmc.Monitor):
|
||||||
monitor = None
|
monitor = None
|
||||||
play_event = None
|
play_event = None
|
||||||
warn = True
|
warn = True
|
||||||
settings = {'last_progress': datetime.today()}
|
settings = {'last_progress': datetime.today(), 'last_progress_report': datetime.today()}
|
||||||
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -109,12 +109,13 @@ class Service(xbmc.Monitor):
|
||||||
difference = datetime.today() - self.settings['last_progress']
|
difference = datetime.today() - self.settings['last_progress']
|
||||||
|
|
||||||
if difference.seconds > 10:
|
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})
|
event('ReportProgressRequested', {'Report': update})
|
||||||
|
|
||||||
if update:
|
if update:
|
||||||
self.settings['last_progress'] = datetime.today()
|
self.settings['last_progress_report'] = datetime.today()
|
||||||
|
|
||||||
if window('emby.restart.bool'):
|
if window('emby.restart.bool'):
|
||||||
window('emby.restart', clear=True)
|
window('emby.restart', clear=True)
|
||||||
|
|
Loading…
Reference in a new issue