diff --git a/addons.xml b/addons.xml index 5ce77274..e2cd8210 100644 --- a/addons.xml +++ b/addons.xml @@ -1,6 +1,6 @@ - + diff --git a/addons.xml.md5 b/addons.xml.md5 index ff905c44..72015055 100644 --- a/addons.xml.md5 +++ b/addons.xml.md5 @@ -1 +1 @@ -51931b8fcea9f86aab035f3622d75611 \ No newline at end of file +f62e98208f25d22f935187bf7583c5b0 \ No newline at end of file diff --git a/plugin.video.pseudotv.live/addon.xml b/plugin.video.pseudotv.live/addon.xml index 408b7822..47695cc5 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/autotune.py b/plugin.video.pseudotv.live/resources/lib/autotune.py index 974f3426..5b506489 100644 --- a/plugin.video.pseudotv.live/resources/lib/autotune.py +++ b/plugin.video.pseudotv.live/resources/lib/autotune.py @@ -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: @@ -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 diff --git a/plugin.video.pseudotv.live/resources/lib/globals.py b/plugin.video.pseudotv.live/resources/lib/globals.py index 04ba1161..7b1d319a 100644 --- a/plugin.video.pseudotv.live/resources/lib/globals.py +++ b/plugin.video.pseudotv.live/resources/lib/globals.py @@ -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)) diff --git a/plugin.video.pseudotv.live/resources/lib/kodi.py b/plugin.video.pseudotv.live/resources/lib/kodi.py index c85d597b..ee5eccb8 100644 --- a/plugin.video.pseudotv.live/resources/lib/kodi.py +++ b/plugin.video.pseudotv.live/resources/lib/kodi.py @@ -1067,11 +1067,13 @@ 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)') @@ -1079,7 +1081,7 @@ def closeBusyDialog(self): @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 diff --git a/plugin.video.pseudotv.live/resources/lib/overlay.py b/plugin.video.pseudotv.live/resources/lib/overlay.py index cdc405a1..b0e22a57 100644 --- a/plugin.video.pseudotv.live/resources/lib/overlay.py +++ b/plugin.video.pseudotv.live/resources/lib/overlay.py @@ -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 diff --git a/plugin.video.pseudotv.live/resources/lib/service.py b/plugin.video.pseudotv.live/resources/lib/service.py index a19fe192..818415ba 100644 --- a/plugin.video.pseudotv.live/resources/lib/service.py +++ b/plugin.video.pseudotv.live/resources/lib/service.py @@ -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 @@ -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() diff --git a/plugin.video.pseudotv.live/resources/lib/tasks.py b/plugin.video.pseudotv.live/resources/lib/tasks.py index b91fd438..14e09d6b 100644 --- a/plugin.video.pseudotv.live/resources/lib/tasks.py +++ b/plugin.video.pseudotv.live/resources/lib/tasks.py @@ -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) - - \ No newline at end of file + DIALOG.progressDialog(100, dia) \ No newline at end of file diff --git a/plugin.video.pseudotv.live/resources/lib/utilities.py b/plugin.video.pseudotv.live/resources/lib/utilities.py index 51471e30..59ecc30f 100644 --- a/plugin.video.pseudotv.live/resources/lib/utilities.py +++ b/plugin.video.pseudotv.live/resources/lib/utilities.py @@ -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): diff --git a/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.7m.zip b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.7m.zip new file mode 100644 index 00000000..f498e8b6 Binary files /dev/null and b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.7m.zip differ