diff --git a/addons.xml b/addons.xml index 80798b6c..37445039 100644 --- a/addons.xml +++ b/addons.xml @@ -1,6 +1,6 @@ - + diff --git a/addons.xml.md5 b/addons.xml.md5 index 12ecfa64..46f6bd85 100644 --- a/addons.xml.md5 +++ b/addons.xml.md5 @@ -1 +1 @@ -e2a439012b1c08b741a672583987dd12 \ No newline at end of file +e23e750bcf64d63e0f99e9ad5360d184 \ No newline at end of file diff --git a/plugin.video.pseudotv.live/addon.xml b/plugin.video.pseudotv.live/addon.xml index 80ff6921..3cf0c4cd 100644 --- a/plugin.video.pseudotv.live/addon.xml +++ b/plugin.video.pseudotv.live/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/plugin.video.pseudotv.live/resources/lib/cqueue.py b/plugin.video.pseudotv.live/resources/lib/cqueue.py index 303b79a2..df6e52b6 100644 --- a/plugin.video.pseudotv.live/resources/lib/cqueue.py +++ b/plugin.video.pseudotv.live/resources/lib/cqueue.py @@ -72,7 +72,7 @@ def __exists(self, package): for idx, item in enumerate(self.min_heap): _,epriority,epackage = item if epackage == package[2]: - if epriority <= package[1]: return True + if epriority >= package[1]: return True else: self.log("__exists, pop func = %s"%(epackage[0].__name__)) try: self.min_heap.pop(idx) @@ -85,7 +85,7 @@ def _push(self, package: tuple, priority: int=0, delay: int=0): self.log("_push, func = %s"%(package[0].__name__)) node = LlNode(package, priority, delay) if self.__exists((1,priority,package)): - self.log("_push, %s exists; ignoring package"%(package[2])) + self.log("_push, %s exists; ignoring package"%(package)) return elif self.priority: self.qsize += 1 diff --git a/plugin.video.pseudotv.live/resources/lib/overlay.py b/plugin.video.pseudotv.live/resources/lib/overlay.py index c091289e..ec0bce08 100644 --- a/plugin.video.pseudotv.live/resources/lib/overlay.py +++ b/plugin.video.pseudotv.live/resources/lib/overlay.py @@ -248,7 +248,10 @@ def _cancelChannelBug(self): self._setImage(self._channelBug,' ') self._setVisible(self._channelBug,False) if self._channelBugThread.is_alive(): - self._channelBugThread.cancel() + try: + self._channelBugThread.cancel() + self._channelBugThread.join() + except: pass def toggleBackground(self, state: bool=True): @@ -317,18 +320,17 @@ def _getWait(state): if not self._hasControl(self._channelBug): self._addControl(self._channelBug) self._channelBug.setVisibleCondition('Player.Playing + [!String.Contains(VideoPlayer.Genre,Pre-Roll) | !String.Contains(VideoPlayer.Genre,Post-Roll)]') - + self._channelBug.setAnimations([('Conditional', 'effect=fade start=0 end=100 time=2000 delay=1000 condition=True reversible=False'), + ('Conditional', 'effect=fade start=100 end=25 time=1000 delay=3000 condition=True reversible=False')]) + logo = self.player.sysInfo.get('citem',{}).get('logo',(BUILTIN.getInfoLabel('Art(icon)','Player') or LOGO)) self.log('toggleBug, channelbug logo = %s)'%(logo)) - if self.channelBugDiffuse: self._channelBug.setColorDiffuse(self.channelBugColor) - elif hasAddon('script.module.pil'): - if self.resources.isMono(logo): self._channelBug.setColorDiffuse(self.channelBugColor) + if self.channelBugDiffuse: self._channelBug.setColorDiffuse(self.channelBugColor) + elif self.resources.isMono(logo): self._channelBug.setColorDiffuse(self.channelBugColor) self._setImage(self._channelBug,logo) self._setVisible(self._channelBug,True) - self._channelBug.setAnimations([('Conditional', 'effect=fade start=0 end=100 time=2000 delay=500 condition=True reversible=False'), - ('Conditional', 'effect=fade start=100 end=25 time=1000 delay=2000 condition=True reversible=False')]) else: self._setVisible(self._channelBug,False) self._setImage(self._channelBug,'None') diff --git a/plugin.video.pseudotv.live/resources/lib/plugin.py b/plugin.video.pseudotv.live/resources/lib/plugin.py index 4ab2048d..d208159c 100644 --- a/plugin.video.pseudotv.live/resources/lib/plugin.py +++ b/plugin.video.pseudotv.live/resources/lib/plugin.py @@ -363,7 +363,8 @@ def playError(self): return BUILTIN.executebuiltin('PlayMedia(%s%s)'%(self.sysARG[0],self.sysARG[2])) #retry channel elif self.sysInfo.get('playcount') == 4: DIALOG.okDialog(LANGUAGE(32134)%(ADDON_NAME)) else: DIALOG.notificationWait(LANGUAGE(32000)) - self.resolveURL(False, xbmcgui.ListItem()) #release pending playback. + self.resolveURL(False, xbmcgui.ListItem()) #release pending playback + DIALOG.closeBusyDialog() def resolveURL(self, found, listitem): diff --git a/plugin.video.pseudotv.live/resources/lib/service.py b/plugin.video.pseudotv.live/resources/lib/service.py index 1bd08ea1..594a520c 100644 --- a/plugin.video.pseudotv.live/resources/lib/service.py +++ b/plugin.video.pseudotv.live/resources/lib/service.py @@ -70,7 +70,7 @@ def onPlayBackStarted(self): def onAVChange(self): self.log('onAVChange') - self.isIdle = self.service.monitor.chkIdle() + if self.isPseudoTV: self._onPlay() def onAVStarted(self): @@ -181,9 +181,10 @@ def _onPlay(self): self.log('_onPlay') self.toggleReplay(False) self.toggleBackground(False) + self.service.monitor.chkIdle() + oldInfo = self.sysInfo self.sysInfo = self.getPlayerSysInfo() #get current sysInfo - #items that only run once per channel change. ie. set adv. rules and variables. if self.sysInfo.get('chid') != oldInfo.get('chid',random.random()): #playing new channel self.runActions(RULES_ACTION_PLAYER_START, self.sysInfo.get('citem',{}), inherited=self) @@ -244,12 +245,13 @@ def toggleReplay(self, state: bool=True): def toggleBackground(self, state: bool=True): self.log('toggleBackground, state = %s'%(state)) if state: - if hasattr(self.background, 'show'): self.background.show() + if not hasattr(self.background, 'show'): + self.background = Background(BACKGROUND_XML, ADDON_PATH, "default", player=self) + self.background.show() else: if hasattr(self.background, 'close'): self.background = self.background.close() if self.isPlaying(): BUILTIN.executebuiltin('ReplaceWindow(fullscreenvideo)') - self.background = Background(BACKGROUND_XML, ADDON_PATH, "default", player=self) class Monitor(xbmc.Monitor): @@ -285,35 +287,29 @@ def getIdle(self): def chkIdle(self): self.isIdle, self.idleTime = self.getIdle() - if self.sleepTime > 0 and (self.idleTime > (self.sleepTime * 10800)): #3hr increments - if self.triggerSleep(): return False - if self.isIdle: self.toggleOverlay(True) - else: self.toggleOverlay(False) - return self.isIdle + if self.service.player.isPlaying() and not BUILTIN.isPaused(): + if self.sleepTime > 0 and (self.idleTime > (self.sleepTime * 10800)): self.triggerSleep() + if self.isIdle: self.toggleOverlay(True) + else: self.toggleOverlay(False) def toggleOverlay(self, state: bool=True): - if state: - conditions = self.enableOverlay & self.service.player.isPlaying() & self.service.player.isPseudoTV - if not self.overlay and conditions: - self.log("toggleOverlay, state = %s"%(state)) + self.log("toggleOverlay, state = %s"%(state)) + if state and self.enableOverlay: + if not hasattr(self.overlay, 'open'): self.overlay = Overlay(jsonRPC=self.jsonRPC,player=self.service.player) self.overlay.open() else: - if hasattr(self.overlay, 'close'): - self.log("toggleOverlay, state = %s"%(state)) - self.overlay.close() - self.overlay = None + if hasattr(self.overlay, 'close'): + self.overlay = self.overlay.close() def triggerSleep(self): - if not BUILTIN.isPaused(): - conditions = self.service.player.isPlaying() & self.service.player.isPseudoTV - self.log("triggerSleep, conditions = %s"%(conditions)) - if not conditions: return - if self.sleepTimer(): - self.service.player.stop() - return True + if not PROPERTIES.isRunning('triggerSleep'): + with PROPERTIES.setRunning('triggerSleep'): + if self.sleepTimer(): + self.service.player.stop() + return True def sleepTimer(self): @@ -413,7 +409,7 @@ def __playing(self) -> bool: def __tasks(self): self.log('__tasks') - self.tasks._que(self.monitor.chkIdle,1) + if self.player.isPseudoTV: self.tasks._que(self.monitor.chkIdle,1) self.tasks._chkEpochTimer('chkQueTimer',self.tasks._chkQueTimer,EPOCH_TIMER) diff --git a/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.5c.zip b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.5c.zip new file mode 100644 index 00000000..e41cc285 Binary files /dev/null and b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.5c.zip differ