From b21322de1620e86f8a3e2b9e89f7b85cf6defd31 Mon Sep 17 00:00:00 2001 From: Shaun Date: Sat, 24 Feb 2018 09:52:14 +1100 Subject: [PATCH] update activity on disk at tme of activity delete activity once used --- resources/lib/downloadutils.py | 2 +- resources/lib/play_utils.py | 1 + service.py | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index 491c6cc..e0e8e31 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -97,8 +97,8 @@ class DownloadUtils(): log.debug("Version Check Data: {0}", postBody) conn.request(method="POST", url="/version", body=postBody, headers=head) data = conn.getresponse() - ret_data = "null" if int(data.status) == 200: + xbmcvfs.delete(path) ret_data = data.read() log.debug("VERSION_CHECK: RESPONCE: {0}", ret_data) message = json.loads(ret_data) diff --git a/resources/lib/play_utils.py b/resources/lib/play_utils.py index d45ca32..ad3f688 100644 --- a/resources/lib/play_utils.py +++ b/resources/lib/play_utils.py @@ -801,6 +801,7 @@ class Service(xbmc.Player): if playback_type not in self.activity[today]: self.activity[today][playback_type] = 0 self.activity[today][playback_type] += 1 + self.save_activity() def onPlayBackEnded(self): # Will be called when kodi stops playing a file diff --git a/service.py b/service.py index 13dd8a1..9a79c47 100644 --- a/service.py +++ b/service.py @@ -105,8 +105,6 @@ while not xbmc.abortRequested: xbmc.sleep(1000) -monitor.save_activity() - # stop the WebSocket Client websocket_client.stop_client()