Skip to content

Commit

Permalink
v.0.5.7m
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Jan 8, 2025
1 parent c4fe799 commit a585b27
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 27 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.7l" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.7m" 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 @@
51931b8fcea9f86aab035f3622d75611
f62e98208f25d22f935187bf7583c5b0
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.7l" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.7m" 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/autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _runTune(self, samples: bool=False, rebuild: bool=False, dia=None):

def selectAUTOTUNE(self, ATtype: str, autoSelect: bool=False, rebuildChannels: bool=False):
self.log('selectAUTOTUNE, ATtype = %s, autoSelect = %s, rebuildChannels = %s'%(ATtype,autoSelect,rebuildChannels))
def __build(item): return LISTITEMS.buildMenuListItem(item['name'],item['type'],item['logo'])
def __buildMenuItem(item): return LISTITEMS.buildMenuListItem(item['name'],item['type'],item['logo'])

def _match(enabledItems):
for item in enabledItems:
Expand All @@ -121,7 +121,7 @@ def _set(ATtype, selects=[]):
if SETTINGS.getSettingBool('Debug_Enable'): DIALOG.notificationDialog(LANGUAGE(32018)%(ATtype))
return

lizlst = poolit(__build)(items)
lizlst = poolit(__buildMenuItem)(items)
if rebuildChannels:#rebuild channels.json entries
selects = list(_match(self.library.getEnabled(ATtype)))
elif autoSelect:#build sample channels
Expand Down
3 changes: 2 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ def togglePVR(state=True, reverse=False, wait=FIFTEEN):
xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"%s","enabled":%s}, "id": 1}'%(PVR_CLIENT_ID,str(state).lower()))
if not reverse: return
MONITOR().waitForAbort(1.0)
with BUILTIN.busy_dialog(): timerit(togglePVR)(wait,[not bool(state)])
with BUILTIN.busy_dialog():
timerit(togglePVR)(wait,[not bool(state)])
DIALOG.notificationWait('%s: %s'%(PVR_CLIENT_NAME,LANGUAGE(32125)),wait=wait)
else: DIALOG.notificationWait(LANGUAGE(30023)%(PVR_CLIENT_NAME))

Expand Down
8 changes: 5 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,19 +1067,21 @@ def isPaused(self):


def isBusyDialog(self):
return (self.getInfoBool('IsActive(busydialognocancel)','Window') | self.getInfoBool('IsActive(busydialog)','Window'))
return (Properties().isRunning('OVERLAY_BUSY') | self.getInfoBool('IsActive(busydialognocancel)','Window') | self.getInfoBool('IsActive(busydialog)','Window'))


def closeBusyDialog(self):
if self.getInfoBool('IsActive(busydialognocancel)','Window'):
if hasattr(self.busy, 'close'):
self.busy = self.busy.close()
elif self.getInfoBool('IsActive(busydialognocancel)','Window'):
self.executebuiltin('Dialog.Close(busydialognocancel)')
elif self.getInfoBool('IsActive(busydialog)','Window'):
self.executebuiltin('Dialog.Close(busydialog)')


@contextmanager
def busy_dialog(self):
if not Properties().isRunning('OVERLAY_BUSY'):
if not self.isBusyDialog():
try:
if self.busy is None:
from overlay import Busy
Expand Down
29 changes: 16 additions & 13 deletions plugin.video.pseudotv.live/resources/lib/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,21 +389,24 @@ def _cancelOnNext(self):


def toggleOnNext(self, state: bool=True, cancel: bool=False):
def __getOnNextInterval(interval, remaining, displayTime):
totalTime = (int(self.player.getPlayerTime()) * (self.maxProgress / 100)) #total time minus max threshold
elapsed = self.player.getElapsedTime()
showTime = (totalTime - displayTime)
sleepTime = roundupDIV(showTime,interval)
if remaining < self.minDuration: return False, 0, 0
elif remaining < sleepTime: return __getOnNextInterval(interval+1, remaining, displayTime)
def __getOnNextInterval(interval, displayTime):
conditions = self.chkOnNextConditions()
showOnNext = (elapsed >= showTime and remaining >= sleepTime and totalTime > self.minDuration and conditions)
self.log('toggleOnNext, __getOnNextInterval: interval = %s, totalTime = %s, showTime = %s, remaining = %s, elapsed = %s, displayTime = %s, sleepTime = %s, conditions = %s, showOnNext = %s'%(interval,totalTime,showTime,remaining,elapsed,displayTime,sleepTime,conditions,showOnNext))
return showOnNext, sleepTime, displayTime

totalTime = int(self.player.getPlayerTime() * (self.maxProgress / 100))
remaining = int(totalTime - self.player.getPlayedTime())
threshold = roundupDIV(totalTime,4)
intTime = roundupDIV(threshold,interval)

self.log('toggleOnNext, conditions = %s, totalTime = %s, remaining = %s, threshold = %s, intTime = %s'%(conditions, totalTime, remaining, threshold, intTime))
if not conditions or remaining <= self.minDuration: return False, remaining, 0
elif remaining > threshold: return False, abs(remaining - threshold), 0
elif remaining < intTime: return __getOnNextInterval(interval+1, displayTime)
else: return True, abs(intTime - displayTime), displayTime

if self.enableOnNext:
showOnNext, sleepTime, displayTime = __getOnNextInterval(ON_NEXT_COUNT,abs(floor(self.player.getRemainingTime())),int(OSD_TIMER * ON_NEXT_COUNT))
wait = {True:displayTime,False:float(sleepTime)}[state]
showOnNext, sleepTime, displayTime = __getOnNextInterval(ON_NEXT_COUNT,int(OSD_TIMER * ON_NEXT_COUNT))
self.log('toggleOnNext, showOnNext = %s, sleepTime = %s, displayTime = %s'%(showOnNext, sleepTime, displayTime))

wait = {True:displayTime,False:sleepTime}[state]
nstate = not bool(state)
sysInfo = self.player.sysInfo.copy()
citem = sysInfo.get('citem',{}) #channel
Expand Down
6 changes: 5 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ def getRemainingTime(self):
except: return -1


def getPlayedTime(self):
try: return self.getTimeLabel(prop='Time')
except: return -1


def getPlayerProgress(self):
try: return int((self.getRemainingTime() / self.getPlayerTime()) * 100)
except: return -1
Expand Down Expand Up @@ -488,7 +493,6 @@ def _start(self):


def _stop(self):
self.monitor.waitForAbort(FIFTEEN) #give remaining active threads time to close.
for thread in thread_enumerate():
if thread.name != "MainThread" and thread.is_alive():
if hasattr(thread, 'cancel'): thread.cancel()
Expand Down
4 changes: 1 addition & 3 deletions plugin.video.pseudotv.live/resources/lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,4 @@ def setUserPath(self, old, new):
FileAccess.copyFolder(old, new, dia)
SETTINGS.setPVRPath(new,prompt=True,force=True)
PROPERTIES.setPendingRestart()
DIALOG.progressDialog(100, dia)


DIALOG.progressDialog(100, dia)
4 changes: 3 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,15 @@ def buildMenu(self, select=None):
def _runAutotune(self):
SETTINGS.setAutotuned(False)
PROPERTIES.setEpochTimer('chkAutoTune')
PROPERTIES.forceUpdateTime('chkChannels')


def _runUpdate(self, full=False):
PROPERTIES.forceUpdateTime('chkChannels')
if full:
SETTINGS.setAutotuned(False)
PROPERTIES.forceUpdateTime('chkLibrary')
PROPERTIES.forceUpdateTime('chkChannels')
PROPERTIES.setPendingRestart()


def deleteFiles(self, msg, full: bool=False):
Expand Down
Binary file not shown.

0 comments on commit a585b27

Please sign in to comment.