Skip to content

Commit

Permalink
v.0.5.4e
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Sep 17, 2024
1 parent b55be91 commit 6e9a064
Show file tree
Hide file tree
Showing 12 changed files with 31 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.4d" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.4e" 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 @@
fbd7adac3408c346990022793e092f2a
6157b370d1a203fbc52477eeb97f0c8a
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.4d" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.4e" 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/context_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def add(self):
ritem = m3u.getRecordItem(self.fitem,{'1':0,'2':seek}[str(int(retval))])
if (m3u.addRecording(ritem), xmltv.addRecording(ritem,self.fitem)):
DIALOG.notificationWait('%s\n%s'%(ritem['label'],LANGUAGE(30116)))
PROPERTIES.setEXTProperty('chkPVRRefresh','true')
PROPERTIES.setEXTProperty('%s.chkPVRRefresh'%(ADDON_ID),'true')
del m3u
del xmltv

Expand All @@ -63,7 +63,7 @@ def remove(self):
ritem = (self.fitem.get('citem') or {"name":self.fitem['label'],"path":self.listitem.getPath()})
if (m3u.delRecording(ritem), xmltv.delRecording(ritem)):
DIALOG.notificationWait('%s\n%s'%(ritem['name'],LANGUAGE(30118)))
PROPERTIES.setEXTProperty('chkPVRRefresh','true')
PROPERTIES.setEXTProperty('%s.chkPVRRefresh'%(ADDON_ID),'true')
del m3u
del xmltv

Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def buildWebBase(self, local=False):
elif setting.get('id','').lower() == 'services.webserverport': port = setting.get('value')
elif setting.get('id','').lower() == 'services.webserverpassword': password = setting.get('value')
elif setting.get('id','').lower() == 'services.webserverssl' and setting.get('value'): secure = True
username = '{0}:{1}@'.format(username, password) if username and password else ''
username = '{0}:{1}@'.format(username, password) if username and password else ''
protocol = 'https' if secure else 'http'
if local: ip = 'localhost'
else: ip = getIP()
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/m3u.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def findStation(self, citem):

def findRecording(self, ritem):
for idx, eitem in enumerate(self.M3UDATA.get('recordings',[])):
if (ritem.get('id',str(random.random())) == eitem.get('id')) or (ritem.get('label',str(random.random())).lower() == eitem.get('label','').lower()) or (ritem.get('path','').endswith('%s.pvr'%(eitem.get('name')))):
if (ritem.get('id',str(random.random())) == eitem.get('id')) or (ritem.get('label',str(random.random())).lower() == eitem.get('label','').lower()) or (ritem.get('path',str(random.random())).endswith('%s.pvr'%(eitem.get('name')))):
self.log('findRecording, found eitem = %s'%(eitem))
return idx, eitem
return None, {}
Expand Down
19 changes: 9 additions & 10 deletions plugin.video.pseudotv.live/resources/lib/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
class Background(xbmcgui.WindowXML):
def __init__(self, *args, **kwargs):
xbmcgui.WindowXML.__init__(self, *args, **kwargs)
self.citem = kwargs.get('citem',{})
self.sysInfo = kwargs.get('sysInfo',{})


def onInit(self):
try:
logo = (self.citem.get('logo',(BUILTIN.getInfoLabel('Art(icon)','Player') or COLOR_LOGO)))
logo = (self.sysInfo.get('citem',{}).get('logo',(BUILTIN.getInfoLabel('Art(icon)','Player') or COLOR_LOGO)))
self.getControl(40001).setVisibleCondition('[!Player.Playing]')
self.getControl(40002).setImage(COLOR_LOGO if logo.endswith('wlogo.png') else logo)
self.getControl(40003).setText(LANGUAGE(32104)%(self.citem.get('name',(BUILTIN.getInfoLabel('ChannelName','VideoPlayer') or ADDON_NAME))))
self.getControl(40003).setText(LANGUAGE(32104)%(self.sysInfo.get('citem',{}).get('name',(BUILTIN.getInfoLabel('ChannelName','VideoPlayer') or ADDON_NAME))))
except Exception as e:
log("Background: onInit, failed! %s"%(e), xbmc.LOGERROR)
self.close()
Expand All @@ -60,7 +60,6 @@ def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
self._closing = False
self.myPlayer = kwargs.get('player' ,None)
self.sysInfo = kwargs.get('sysInfo',{})


def onInit(self):
Expand All @@ -71,7 +70,7 @@ def onInit(self):
self._progressLoop(self.getControl(40000))
self.setFocusId(40001)
except Exception as e:
log("Replay: onInit, failed! %s\ncitem = %s"%(e,self.sysInfo), xbmc.LOGERROR)
log("Replay: onInit, failed! %s\ncitem = %s"%(e,self.myPlayer.sysInfo), xbmc.LOGERROR)
self._onClose()


Expand All @@ -90,11 +89,11 @@ def onAction(self, act):
actionId = act.getId()
log('Replay: onAction: actionId = %s'%(actionId))
if actionId in ACTION_SELECT_ITEM and self.getFocusId(40001):
if self.sysInfo.get('isPlaylist',False): self.myPlayer.seekTime(0)
elif self.sysInfo.get('fitem'):
liz = LISTITEMS.buildItemListItem(self.sysInfo.get('fitem',{}))
liz.setProperty('sysInfo',encodeString(dumpJSON(self.sysInfo)))
self.myPlayer.play(self.sysInfo.get('fitem',{}).get('catchup-id'),liz)
if self.myPlayer.sysInfo.get('isPlaylist',False): self.myPlayer.seekTime(0)
elif self.myPlayer.sysInfo.get('fitem'):
liz = LISTITEMS.buildItemListItem(self.myPlayer.sysInfo.get('fitem',{}))
liz.setProperty('sysInfo',encodeString(dumpJSON(self.myPlayer.sysInfo)))
self.myPlayer.play(self.myPlayer.sysInfo.get('fitem',{}).get('catchup-id'),liz)
else: DIALOG.notificationDialog(LANGUAGE(30154))
elif actionId == ACTION_MOVE_UP: BUILTIN.executebuiltin('AlarmClock(up,Action(up),time,100,true,false)')
elif actionId == ACTION_MOVE_DOWN: BUILTIN.executebuiltin('AlarmClock(down,Action(down),time,100,true,false)')
Expand Down
15 changes: 10 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def getLocalLogo(self, chname: str, select: bool=False) -> list:
def getLogoResources(self, chname: str, type: str, select: bool=False) -> dict and None:
self.log('getLogoResources, chname = %s, type = %s'%(chname, type))
resources = SETTINGS.getSetting('Resource_Logos').split('|').copy()
if type in ["TV Genres","Movie Genres"]: resources.extend(GENRE_RESOURCE)
if type in ["TV Genres","Movie Genres"]: resources.extend(GENRE_RESOURCE)
elif type in ["TV Networks","Movie Studios"]: resources.extend(STUDIO_RESOURCE)
elif type == "Music Genres": resources.extend(MUSIC_RESOURCE)
else:
Expand Down Expand Up @@ -134,11 +134,16 @@ def matchName(self, chname: str, name: str, type: str='Custom', auto: bool=False
for rename in renames:
if chname.lower() == rename.lower(): return True
for pattern in patterns:
try: label = pattern(rename,type)
except: label = pattern(rename)
try:
rrename = pattern(rename,type)
rchname = pattern(chname,type)
except:
rrename = pattern(rename)
rchname = pattern(chname)
finally:
if isinstance(label,(list,tuple)) and len(label) > 1: label = label[0]
if chname.lower() == label.lower(): return True
if isinstance(rrename,(list,tuple)) and len(rrename) > 1: rrename = rrename[0]
if isinstance(rchname,(list,tuple)) and len(rchname) > 1: rchname = rchname[0]
if chname.lower() == rrename.lower() or rename.lower() == rchname.lower() or rchname.lower() == rrename.lower(): return True


def buildWebImage(self, image: str) -> str:
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 @@ -234,7 +234,7 @@ def toggleReplay(self, state: bool=True, sysInfo: dict={}):
if state and bool(self.enableReplay) and not self.isIdle and sysInfo.get('fitem'):
progress = self.getPlayerProgress()
if (progress >= self.enableReplay and progress < SETTINGS.getSettingInt('Seek_Threshold')):
self.replay = Replay("%s.replay.xml"%(ADDON_ID), ADDON_PATH, "default", "1080i", player=self, sysInfo=sysInfo)
self.replay = Replay("%s.replay.xml"%(ADDON_ID), ADDON_PATH, "default", "1080i", player=self)
self.replay.doModal()
elif hasattr(self.replay, 'close'): self.replay.close()

Expand All @@ -247,7 +247,7 @@ def toggleBackground(self, state: bool=True):
if hasattr(self.background, 'close'):
self.background = self.background.close()
if self.isPlaying(): BUILTIN.executebuiltin('ReplaceWindow(fullscreenvideo)')
self.background = Background("%s.background.xml"%(ADDON_ID), ADDON_PATH, "default", citem=self.sysInfo.get('citem',{}))
self.background = Background("%s.background.xml"%(ADDON_ID), ADDON_PATH, "default", sysInfo=self.sysInfo)


class Monitor(xbmc.Monitor):
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def chkChannels(self):
if PROPERTIES.hasFirstrun(): self._que(self.chkChannels,2)
else:
self.service.currentChannels = list(channels)
if updated: PROPERTIES.setEXTProperty('chkPVRRefresh','true')
if updated: PROPERTIES.setEXTProperty('%s.chkPVRRefresh'%(ADDON_ID),'true')
if not PROPERTIES.hasFirstrun(): PROPERTIES.setFirstrun(state=True)
except Exception as e:
self.log('chkChannels failed! %s'%(e), xbmc.LOGERROR)
Expand All @@ -217,7 +217,7 @@ def chkChannels(self):
def chkPVRservers(self):
self.log('chkPVRservers')
if self.multiroom.chkPVRservers():
PROPERTIES.setEXTProperty('chkPVRRefresh','true')
PROPERTIES.setEXTProperty('%s.chkPVRRefresh'%(ADDON_ID),'true')


def chkPVRSettings(self):
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def openChannelBug(self):

def _togglePVR(self):
if DIALOG.yesnoDialog('%s?'%(LANGUAGE(32121)%(xbmcaddon.Addon(PVR_CLIENT_ID).getAddonInfo('name')))):
PROPERTIES.setEXTProperty('chkPVRRefresh','true')
PROPERTIES.setEXTProperty('%s.chkPVRRefresh'%(ADDON_ID),'true')


def buildMenu(self, select=None):
Expand Down
Binary file not shown.

0 comments on commit 6e9a064

Please sign in to comment.