From 76dde9f8dd3e11651cb537f5b964b67882a7d35d Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Mon, 5 Mar 2018 01:15:08 -0600 Subject: [PATCH] Fix widget detection modification --- resources/lib/playbackutils.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/resources/lib/playbackutils.py b/resources/lib/playbackutils.py index 1a5275fb..30b7c08d 100644 --- a/resources/lib/playbackutils.py +++ b/resources/lib/playbackutils.py @@ -56,7 +56,8 @@ class PlaybackUtils(object): kodi_version = xbmc.getInfoLabel('System.BuildVersion') - if kodi_version and "Git:" in kodi_version and int(kodi_version.split('Git:')[1].split("-")[0]) <= 20171119: + if kodi_version and "Git:" in kodi_version and kodi_version.split('Git:')[1].split("-")[0] == '20171119': + #TODO: To be reviewed once Leia is out. log.info("Build does not require workaround for widgets?") return False @@ -121,6 +122,9 @@ class PlaybackUtils(object): log.info("seektime detected (percent): %s", seektime_percent) listitem.setProperty('StartPercent', str(seektime_percent)) + # Prevent manually mark as watched in Kodi monitor + window('emby.skip.%s' % item_id, value="true") + # Stack: [(url, listitem), (url, ...), ...] self.stack[0][1].setPath(self.stack[0][0]) try: @@ -350,11 +354,18 @@ class PlaybackUtils(object): db_id = item_db[0] if item_db else None pbutils = PlaybackUtils(item) - pbutils.set_playlist(play_url, item_id, listitem, seektime if item_ids.index(item_id) == 1 else None, db_id) + pbutils.set_playlist(play_url, item_id, listitem, seektime if item_ids.index(item_id) == 0 else None, db_id) + + if item_ids.index(item_id) == 0 and seektime: - if item_ids.index(item_id) == 1 and seektime: log.info("Seektime detected: %s", self.API.adjust_resume(seektime)) listitem.setProperty('StartOffset', str(self.API.adjust_resume(seektime))) + + ''' + seektime_percent = ((seektime/self.API.get_runtime()) * 100) - 0.40 + log.info("seektime detected (percent): %s", seektime_percent) + listitem.setProperty('StartPercent', str(seektime_percent)) + ''' index = max(pbutils.playlist.getposition(), 0) + 1 # Can return -1 @@ -375,3 +386,4 @@ class PlaybackUtils(object): if started: return True +