From 939d52f54ec655f4b82b35c1cf808f244233db0b Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 19 Jan 2018 01:42:05 -0600 Subject: [PATCH] Adjust playback Fix watched caused by intros --- resources/lib/entrypoint.py | 10 +++++----- resources/lib/playbackutils.py | 14 ++++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index a42d2626..92488468 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -110,11 +110,11 @@ def doMainListing(): log.info(window('emby_server%s.name' % server)) addDirectoryItem(window('emby_server%s.name' % server), "plugin://plugin.video.emby/?mode=%s" % server)''' - addDirectoryItem("Manual login dialog", "plugin://plugin.video.emby/?mode=manuallogin") - addDirectoryItem("Connect login dialog", "plugin://plugin.video.emby/?mode=connectlogin") - addDirectoryItem("Manual server dialog", "plugin://plugin.video.emby/?mode=manualserver") - addDirectoryItem("Connect servers dialog", "plugin://plugin.video.emby/?mode=connectservers") - addDirectoryItem("Connect users dialog", "plugin://plugin.video.emby/?mode=connectusers") + #addDirectoryItem("Manual login dialog", "plugin://plugin.video.emby/?mode=manuallogin") + #addDirectoryItem("Connect login dialog", "plugin://plugin.video.emby/?mode=connectlogin") + #addDirectoryItem("Manual server dialog", "plugin://plugin.video.emby/?mode=manualserver") + #addDirectoryItem("Connect servers dialog", "plugin://plugin.video.emby/?mode=connectservers") + #addDirectoryItem("Connect users dialog", "plugin://plugin.video.emby/?mode=connectusers") addDirectoryItem(lang(30517), "plugin://plugin.video.emby/?mode=passwords") addDirectoryItem(lang(33053), "plugin://plugin.video.emby/?mode=settings") diff --git a/resources/lib/playbackutils.py b/resources/lib/playbackutils.py index 3c32b28e..1b23e04f 100644 --- a/resources/lib/playbackutils.py +++ b/resources/lib/playbackutils.py @@ -74,7 +74,7 @@ class PlaybackUtils(object): log.info("Clear the playlist.") self.playlist.clear() - self.set_playlist(play_url, item_id, listitem, seektime, dbid) + self.set_playlist(play_url, item_id, listitem, seektime, dbid, force_transcode) ##### SETUP PLAYBACK @@ -99,7 +99,6 @@ class PlaybackUtils(object): except IndexError: log.info("Playback activated via the context menu or widgets.") force_play = True - self.stack[0][1].setProperty('StartOffset', str(seektime)) for stack in self.stack: self.playlist.add(url=stack[0], listitem=stack[1], index=index) @@ -108,7 +107,7 @@ class PlaybackUtils(object): if force_play: xbmc.Player().play(self.playlist) - def set_playlist(self, play_url, item_id, listitem, seektime=None, db_id=None): + def set_playlist(self, play_url, item_id, listitem, seektime=None, db_id=None, force_transcode=False): ##### CHECK FOR INTROS @@ -121,6 +120,9 @@ class PlaybackUtils(object): self.set_listitem(listitem, db_id) self.stack.append([play_url, listitem]) + if force_transcode and seektime: + listitem.setProperty('StartOffset', str(seektime)) + ##### ADD ADDITIONAL PARTS if self.item.get('PartCount'): @@ -148,6 +150,9 @@ class PlaybackUtils(object): url = putils.PlayUtils(intro, listitem).get_play_url() log.info("Adding Intro: %s" % url) + pb = PlaybackUtils(intro) + pb.set_listitem(listitem) + self.stack.append([url, listitem]) def _set_additional_parts(self, item_id): @@ -163,7 +168,6 @@ class PlaybackUtils(object): # Set listitem and properties for each additional parts pb = PlaybackUtils(part) pb.set_properties(url, listitem) - pb.set_artwork(listitem, part['Type']) self.stack.append([url, listitem]) @@ -204,6 +208,8 @@ class PlaybackUtils(object): if dbid: metadata['dbid'] = dbid + else: + metadata['dbid'] = None listitem.setProperty('IsPlayable', 'true') listitem.setProperty('IsFolder', 'false')