Skip to content

Commit

Permalink
v.0.5.1s
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Aug 6, 2024
1 parent 34da0bd commit ed99fce
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 42 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.1r" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.1s" 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 @@
d246ae1f32845236388e4ec13c3256c5
5250253571219e5da38d8d31b91a9a95
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.1r" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.1s" 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
9 changes: 7 additions & 2 deletions plugin.video.pseudotv.live/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
v.0.5.2
-Completed Holiday channels
-Improved queue priorities.
-Added PVR backend refresh at the end of channel building; This will force Kodi to recognize recent PseudoTV additions.
-Fixed a few user reported issues that were introduced in recent iterations.
- Channels not building due to limit Smartplaylist parsing error.
- Channels ignoring auto pagination; leading to repeated content.
-Completed Holiday channels.
-Fixed Playlist Playback not progressing.
-Fixed Recordings Persistence issues.
-Fixed Recordings Persistence issues.
-Added Automatic Recordings Cleanup to settings.
-Improved Channel Manager logo utility.
-Improved Channel Manager path utility.
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def buildList(self, citem: dict, path: str, media: str='video', page: int=SETTIN
self.log("buildList, id: %s, no request items found using path = %s\nreturning: fileList (%s), dirList (%s)"%(citem['id'],path,len(fileList),len(dirList)))
self.pErrors.append(LANGUAGE(32026))
return fileList, dirList
else:
elif items:
self.loopback = items
for idx, item in enumerate(items):
if self.service._interrupt() or self.service._suspend():
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

PTVL_REPO = 'repository.pseudotv'
PVR_CLIENT_ID = 'pvr.iptvsimple'
PVR_CLIENT_NAME = xbmcaddon.Addon(id=PVR_CLIENT_ID).getAddonInfo('name')
PVR_CLIENT_NAME = 'IPTV Simple Client'

#docs
README_FLE = os.path.join(ADDON_PATH,'README.md')
Expand Down
10 changes: 5 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/cqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __exists(self, package):
for idx, item in enumerate(self.min_heap):
_,epriority,epackage = item
if epackage == package[2]:
if epriority <= package[0]: return True
if epriority <= package[1]: return True
else:
self.min_heap.pop(idx)
return False
Expand All @@ -79,10 +79,10 @@ def __exists(self, package):

def _push(self, package: tuple, priority: int=0, delay: int=0):
self.log("_push, func = %s"%(package[0].__name__))
node = LlNode(package, priority, delay)
exist = self.__exists((1,priority,package))
self.log("_push, exist = %s"%(exist))
if exist: return
node = LlNode(package, priority, delay)
if self.__exists((1,priority,package)):
self.log("_push, exists... ignoring package")
return
elif self.priority:
self.qsize += 1
item = (priority, package)
Expand Down
32 changes: 10 additions & 22 deletions plugin.video.pseudotv.live/resources/lib/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
SETTINGS = DIALOG.settings
LISTITEMS = DIALOG.listitems
BUILTIN = DIALOG.builtin

@contextmanager
def legacy():
setLegacy(True)
Expand Down Expand Up @@ -442,28 +443,15 @@ def IPTV_SIMPLE_SETTINGS(): #recommended IPTV Simple settings
'numberByOrder' :'false',
'startNum' :'1'}

def togglePVR(state=True, reverse=False, waitTime=15):
log('globals: togglePVR, state = %s, reverse = %s, waitTime = %s'%(state,reverse,waitTime))
BUILTIN.executebuiltin('ActivateWindow(home)')
isEnabled = BUILTIN.getInfoBool('AddonIsEnabled(%s)'%(PVR_CLIENT_ID),'System')
if (state and isEnabled) or (not state and not isEnabled): return
xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"%s","enabled":%s}, "id": 1}'%(PVR_CLIENT_ID,str(state).lower()))
xbmc.sleep(250)
if reverse: timerit(togglePVR)(waitTime,[not bool(state)])
else: waitTime = int(PROMPT_DELAY/1000)
DIALOG.notificationWait('%s: %s'%(PVR_CLIENT_NAME,LANGUAGE(32125)),wait=waitTime)

def bruteForcePVR(msg=''):
if (BUILTIN.getInfoBool('IsPlayingTv','Pvr') | BUILTIN.getInfoBool('IsPlayingRadio','Pvr')): msg = LANGUAGE(32128)
if DIALOG.yesnoDialog('%s\n%s?\n%s'%(LANGUAGE(32129)%(PVR_CLIENT_NAME),(LANGUAGE(32121)%(PVR_CLIENT_NAME)),msg)):
brutePVR(True)

def brutePVR(override=False, waitTime: float=15.0):
if not override:
if not DIALOG.yesnoDialog('%s?'%(LANGUAGE(32121)%(xbmcaddon.Addon(PVR_CLIENT_ID).getAddonInfo('name')))): return
togglePVR(False,True,waitTime)
if MONITOR.waitForAbort(waitTime): return False
return True
def togglePVR(state=True, reverse=False, wait=4):
log('globals: togglePVR, state = %s, reverse = %s, wait = %s'%(state,reverse,wait))
if not (BUILTIN.getInfoBool('IsPlayingTv','Pvr') | BUILTIN.getInfoBool('IsPlayingRadio','Pvr')):
isEnabled = BUILTIN.getInfoBool('AddonIsEnabled(%s)'%(PVR_CLIENT_ID),'System')
if (state and isEnabled) or (not state and not isEnabled): return
xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Addons.SetAddonEnabled","params":{"addonid":"%s","enabled":%s}, "id": 1}'%(PVR_CLIENT_ID,str(state).lower()))
if reverse:
timerit(togglePVR)(wait,[not bool(state)])
DIALOG.notificationWait('%s: %s'%(PVR_CLIENT_NAME,LANGUAGE(32125)),wait=wait)

def hasSubtitle():
return BUILTIN.getInfoBool('HasSubtitles','VideoPlayer')
Expand Down
3 changes: 2 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,9 @@ def requestList(self, citem, path, media='video', page=SETTINGS.getSettingInt('P
param["properties"] = self.getEnums("List.Fields.Files", type='items')
self.log("requestList, id: %s, getDirectory = %s, media = %s, limit = %s, sort = %s, query = %s, limits = %s\npath = %s"%(citem['id'],getDirectory,media,page,sort,query,limits,path))

if limits.get('end') == -1: #global default, replace with autopage.
if limits.get('end',-1) == -1: #global default, replace with autoPagination.
limits = self.autoPagination(citem['id'], '|'.join([path,dumpJSON(query)])) #get
self.log('requestList, id = %s autoPagination limits = %s'%(citem['id'],limits))
if limits.get('total',0) > page and sort.get("method","") == "random":
limits = self.randomPagination(page,limits)
self.log('requestList, id = %s generating random limits = %s'%(citem['id'],limits))
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def runAction(self, actionid, citem, parameter, builder):
if not builder.incExtras and provisional["key"].startswith(tuple(TV_TYPES)): #filter out extras/specials
provisional["filter"].setdefault("and",[]).extend([{"field":"season" ,"operator":"greaterthan","value":"0"},
{"field":"episode","operator":"greaterthan","value":"0"}])
fileList, dirList = builder.buildList(citem, provisional.get('path'), media='video', page=(provisional.get('limit') or builder.limit), sort=provisional.get('sort'), limits={}, dirItem={}, query=provisional)
fileList, dirList = builder.buildList(citem, provisional.get('path'), media='video', page=(provisional.get('limit') or builder.limit), sort=provisional.get('sort'), limits=builder.limits, dirItem={}, query=provisional)
if len(fileList) > 0: self.storedValues[0].append(fileList)
return [_f for _f in self.storedValues.pop(0) if _f]
return parameter
Expand All @@ -849,7 +849,7 @@ class HandleMethodOrder(BaseRule):
def __init__(self):
self.myId = 998
self.ignore = False
self.name = "Page, Limits & Sort Methods"
self.name = "Limits & Sort Methods"
self.description = "Change content limits and sorting methods."
self.optionLabels = ['Page Limit','Method','Order','Ignore Folders','Ignore Artist Sort Name']
self.optionValues = [REAL_SETTINGS.getSettingInt('Page_Limit'),'random','ascending',True,True]
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def setSubtitles(self, state: bool=True):

def setPlaycount(self, state: bool=SETTINGS.getSettingBool('Rollback_Watched'), fitem: dict={}):
self.log('setPlaycount, state = %s, file = %s, playcount = %s'%(state,fitem.get('file'),fitem.get('playcount',0)))
if state and fitem.get('file'): self.myService.tasks._que(self.jsonRPC.quePlaycount,2,fitem)
if state and fitem.get('file'): self.myService.tasks._que(self.jsonRPC.quePlaycount,1,fitem)


def _onPlay(self):
Expand Down Expand Up @@ -324,7 +324,7 @@ def onSettingsChanged(self):

def onSettingsChangedTimer(self):
self.log('onSettingsChangedTimer')
self.myService.tasks._que(self._onSettingsChanged,2)
self.myService.tasks._que(self._onSettingsChanged,1)


def _onSettingsChanged(self):
Expand Down
5 changes: 3 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def chkBackup(self):

def chkPVRBackend(self):
self.log('chkPVRBackend')
if hasAddon(PVR_CLIENT_ID,install=True,enable=True):
if hasAddon(PVR_CLIENT_ID,True,True,True,True):
if SETTINGS.chkPVRInstance('special://profile/addon_data/%s'%(PVR_CLIENT_ID)) == False:
with busy_dialog():
if SETTINGS.chkPluginSettings(PVR_CLIENT_ID,IPTV_SIMPLE_SETTINGS(),override=True):
Expand Down Expand Up @@ -178,6 +178,7 @@ def chkChannels(self):
if complete:
if not hasFirstrun(): setFirstrun(state=True)
self.service.currentChannels = list(channels)
self._que(togglePVR,1,*(False,True),1)
else: self._que(self.chkChannels)
except Exception as e:
self.log('chkChannels failed! %s'%(e), xbmc.LOGERROR)
Expand Down Expand Up @@ -263,7 +264,7 @@ def chkSettingsChange(self, settings=[]):
if nSettings.get(setting) != value and actions.get(setting):
# with sudo_dialog(LANGUAGE(32157)):
self.log('chkSettingsChange, detected change in %s - from: %s to: %s'%(setting,value,nSettings.get(setting)))
self._que(actions[setting].get('func'),2,*actions[settings].get('args',()),**actions[setting].get('kwargs',{}))
self._que(actions[setting].get('func'),1,*actions[settings].get('args',()),**actions[setting].get('kwargs',{}))
return nSettings


Expand Down
7 changes: 6 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,15 @@ def scanLibrary(self):
del library


def togglePVR(self):
if DIALOG.yesnoDialog('%s?'%(LANGUAGE(32121)%(xbmcaddon.Addon(PVR_CLIENT_ID).getAddonInfo('name')))):
togglePVR(False,True)


def buildMenu(self, select=None):
items = [{'label':LANGUAGE(32117),'label2':LANGUAGE(32120),'icon':COLOR_LOGO,'func':self.deleteFiles ,'args':(LANGUAGE(32120),False), 'hide':True}, #"Rebuild M3U/XMLTV"
{'label':LANGUAGE(32118),'label2':LANGUAGE(32119),'icon':COLOR_LOGO,'func':self.deleteFiles ,'args':(LANGUAGE(32119),True) , 'hide':True}, #"Clean Start"
{'label':LANGUAGE(32121)%(PVR_CLIENT_NAME),'label2':LANGUAGE(32122) ,'icon':COLOR_LOGO,'func':brutePVR , 'hide':False}, #"Force PVR reload"
{'label':LANGUAGE(32121)%(PVR_CLIENT_NAME),'label2':LANGUAGE(32122) ,'icon':COLOR_LOGO,'func':self.togglePVR , 'hide':False}, #"Force PVR reload"
{'label':LANGUAGE(32123),'label2':LANGUAGE(32124),'icon':COLOR_LOGO,'func':setPendingRestart , 'hide':False}, #"Force PTVL reload"
{'label':LANGUAGE(32154),'label2':LANGUAGE(32154),'icon':COLOR_LOGO,'func':self.showFile ,'args':(M3UFLEPATH,) , 'hide':False}, #"Show M3U"
{'label':LANGUAGE(32155),'label2':LANGUAGE(32155),'icon':COLOR_LOGO,'func':self.showFile ,'args':(XMLTVFLEPATH,) , 'hide':False}, #"Show XMLTV"
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit ed99fce

Please sign in to comment.