From 354a6669acf88fc220af13f4a7d9af66df3653f2 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 25 Nov 2017 17:34:37 -0600 Subject: [PATCH] Add retries and update playback report to emby --- resources/lib/kodimonitor.py | 3 ++- resources/lib/service_entry.py | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index a224f08e..fd376dee 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -43,7 +43,7 @@ class KodiMonitor(xbmc.Monitor): def onScanFinished(self, library): - log.debug("Kodi library scan %s finished", library) + log.info("Kodi library scan %s finished", library) if library == "video": window('emby_kodiScan', clear=True) @@ -74,6 +74,7 @@ class KodiMonitor(xbmc.Monitor): return if method == 'Player.OnPlay': + self.retry = True self._on_play_(data) elif method == 'VideoLibrary.OnUpdate': diff --git a/resources/lib/service_entry.py b/resources/lib/service_entry.py index 74ca2f5a..8d469819 100644 --- a/resources/lib/service_entry.py +++ b/resources/lib/service_entry.py @@ -291,17 +291,16 @@ class Service(object): kodi_player = self.kodi_player try: play_time = kodi_player.getTime() - filename = kodi_player.currentFile - + filename = kodi_player.getPlayingFile() # Update positionticks - if filename in kodi_player.played_info: + if filename in kodi_player.played_info and play_time > 0: kodi_player.played_info[filename]['currentPosition'] = play_time difference = datetime.today() - self.last_progress difference_seconds = difference.seconds # Report progress to Emby server - if difference_seconds > 3: + if difference_seconds > 9: kodi_player.reportPlayback() self.last_progress = datetime.today()