Skip to content

Commit

Permalink
v.0.5.5c
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Oct 16, 2024
1 parent c15ba51 commit a8f73bd
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 38 deletions.
2 changes: 1 addition & 1 deletion addons.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addons>
<addon id="plugin.video.pseudotv.live" version="0.5.5b" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.5c" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="21.8.0"/>
Expand Down
2 changes: 1 addition & 1 deletion addons.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e2a439012b1c08b741a672583987dd12
e23e750bcf64d63e0f99e9ad5360d184
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.pseudotv.live" version="0.5.5b" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.5c" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="21.8.0"/>
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/cqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
16 changes: 9 additions & 7 deletions plugin.video.pseudotv.live/resources/lib/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
46 changes: 21 additions & 25 deletions plugin.video.pseudotv.live/resources/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)


Expand Down
Binary file not shown.

0 comments on commit a8f73bd

Please sign in to comment.