Skip to content

Commit

Permalink
v.0.5.5m
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Nov 3, 2024
1 parent a697fa1 commit 8fc870b
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 135 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.5l" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.5m" 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 @@
6bb03f76f36267b5d3fdf294fe5c68dd
d19810376817e2d8a386c15f8ef33278
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.5l" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.5m" 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
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ msgid "Searching for %s logo"
msgstr ""

msgctxt "#30129"
msgid "Offline"
msgid "Enable Kodi ZeroConf?"
msgstr ""

msgctxt "#30130"
Expand Down Expand Up @@ -1825,7 +1825,7 @@ msgid "Server Status:"
msgstr ""

msgctxt "#33130"
msgid "Online"
msgid ""
msgstr ""

msgctxt "#33131"
Expand Down Expand Up @@ -1889,11 +1889,11 @@ msgid "QRCode - Visit Kodi.TV PseudoTV Live Support Forum."
msgstr ""

msgctxt "#33165"
msgid "QRCode - View Instance Snapshot."
msgid "QRCode - View Snapshot."
msgstr ""

msgctxt "#33166"
msgid "QRCode - Submit Instance Snapshot for debugging."
msgid "QRCode - Submit Snapshot for review to http://paste.kodi.tv."
msgstr ""

msgctxt "#33168"
Expand Down Expand Up @@ -1925,7 +1925,7 @@ msgid "Install Log Uploader."
msgstr ""

msgctxt "#33309"
msgid "Submit debugging log for review."
msgid "Submit debugging log for review to http://paste.kodi.tv."
msgstr ""

msgctxt "#33202"
Expand Down
25 changes: 12 additions & 13 deletions plugin.video.pseudotv.live/resources/lib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ def __init__(self, service=None):
self.maxDays = MAX_GUIDEDAYS
self.minEPG = EPG_DURATION

self.bctTypes = {"ratings" :{"min":-1,"max":SETTINGS.getSettingInt('Enable_Preroll') ,"auto":SETTINGS.getSettingInt('Enable_Preroll') == -1,"enabled":bool(SETTINGS.getSettingInt('Enable_Preroll')) ,
"sources" :{"ids":SETTINGS.getSetting('Resource_Ratings').split('|'),"paths":[os.path.join(FILLER_LOC,'Ratings' ,'')]},"items":{}},
"bumpers" :{"min":-1,"max":SETTINGS.getSettingInt('Enable_Preroll') ,"auto":SETTINGS.getSettingInt('Enable_Preroll') == -1,"enabled":bool(SETTINGS.getSettingInt('Enable_Preroll')) ,
"sources" :{"ids":SETTINGS.getSetting('Resource_Bumpers').split('|'),"paths":[os.path.join(FILLER_LOC,'Bumpers' ,'')]},"items":{}},
"adverts" :{"min":-1,"max":SETTINGS.getSettingInt('Enable_Postroll'),"auto":SETTINGS.getSettingInt('Enable_Postroll') == -1,"enabled":bool(SETTINGS.getSettingInt('Enable_Postroll')),
"sources" :{"ids":SETTINGS.getSetting('Resource_Adverts').split('|'),"paths":[os.path.join(FILLER_LOC,'Adverts' ,'')]},"items":{},
"incIspot":SETTINGS.getSettingBool('Include_Adverts_iSpot')},
"trailers":{"min":-1,"max":SETTINGS.getSettingInt('Enable_Postroll'),"auto":SETTINGS.getSettingInt('Enable_Postroll') == -1,"enabled":bool(SETTINGS.getSettingInt('Enable_Postroll')),
"sources" :{"ids":SETTINGS.getSetting('Resource_Trailers').split('|'),"paths":[os.path.join(FILLER_LOC,'Trailers','')]},"items":{},
"incKODI":SETTINGS.getSettingBool('Include_Trailers_KODI'),
"incIMDB":SETTINGS.getSettingBool('Include_Trailers_IMDB')}}

self.service = service
self.jsonRPC = service.jsonRPC
self.cache = service.jsonRPC.cache
Expand All @@ -69,19 +81,6 @@ def __init__(self, service=None):
self.resources = Resources(self.jsonRPC)
self.fillers = Fillers(builder=self)
self.completeBuild = False


self.bctTypes = {"ratings" :{"min":-1,"max":SETTINGS.getSettingInt('Enable_Preroll') ,"auto":SETTINGS.getSettingInt('Enable_Preroll') == -1,"enabled":bool(SETTINGS.getSettingInt('Enable_Preroll')) ,
"sources" :{"ids":SETTINGS.getSetting('Resource_Ratings').split('|'),"paths":[os.path.join(FILLER_LOC,'Ratings' ,'')]},"items":{}},
"bumpers" :{"min":-1,"max":SETTINGS.getSettingInt('Enable_Preroll') ,"auto":SETTINGS.getSettingInt('Enable_Preroll') == -1,"enabled":bool(SETTINGS.getSettingInt('Enable_Preroll')) ,
"sources" :{"ids":SETTINGS.getSetting('Resource_Bumpers').split('|'),"paths":[os.path.join(FILLER_LOC,'Bumpers' ,'')]},"items":{}},
"adverts" :{"min":-1,"max":SETTINGS.getSettingInt('Enable_Postroll'),"auto":SETTINGS.getSettingInt('Enable_Postroll') == -1,"enabled":bool(SETTINGS.getSettingInt('Enable_Postroll')),
"sources" :{"ids":SETTINGS.getSetting('Resource_Adverts').split('|'),"paths":[os.path.join(FILLER_LOC,'Adverts' ,'')]},"items":{},
"incIspot":SETTINGS.getSettingBool('Include_Adverts_iSpot')},
"trailers":{"min":-1,"max":SETTINGS.getSettingInt('Enable_Postroll'),"auto":SETTINGS.getSettingInt('Enable_Postroll') == -1,"enabled":bool(SETTINGS.getSettingInt('Enable_Postroll')),
"sources" :{"ids":SETTINGS.getSetting('Resource_Trailers').split('|'),"paths":[os.path.join(FILLER_LOC,'Trailers','')]},"items":{},
"incKODI":SETTINGS.getSettingBool('Include_Trailers_KODI'),
"incIMDB":SETTINGS.getSettingBool('Include_Trailers_IMDB')}}


def log(self, msg, level=xbmc.LOGDEBUG):
Expand Down
1 change: 0 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/cqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def __exists(self, package):
self.min_heap.pop(idx)
self.log("__exists, pop func = %s"%(epackage[0].__name__))
except:
print(idx, item,self.min_heap,len(self.min_heap))
self.log("__exists, pop failed func = %s, idx = %s"%(epackage[0].__name__,idx))
return False
return False
Expand Down
35 changes: 23 additions & 12 deletions plugin.video.pseudotv.live/resources/lib/multiroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def _chkDiscovery(self):


def hasServers(self, servers={}):
def __chkSettings(settings):
[hasAddon(id,install=True,enable=True) for k,addons in list(settings.items()) for id in addons if id.startswith(('resource','plugin'))]

if not servers: servers = self.getDiscovery()
self.log('hasServers, servers = %s'%(len(servers)))
enabledServers = [server for server in list(servers.values()) if server.get('enabled',False)]
Expand All @@ -65,8 +68,9 @@ def hasServers(self, servers={}):
for server in enabledServers:
online = server.get('online',False)
if self.getRemote(server['remotes'].get('remote')): server['online'] = True
else: server['online'] = False
if online != server['online']: DIALOG.notificationDialog('%s: %s'%(server.get('name'),LANGUAGE(32211)%({True:'green',False:'red'}[server.get('online',False)],{True:LANGUAGE(33130),False:LANGUAGE(30129)}[server.get('online',False)])))
else: server['online'] = False
__chkSettings(loadJSON(server.get('settings')))
if online != server.get('online',False): DIALOG.notificationDialog('%s: %s'%(server.get('name'),LANGUAGE(32211)%({True:'green',False:'red'}[server.get('online',False)],{True:'Online',False:'Offline'}[server.get('online',False)])))
return servers


Expand All @@ -88,7 +92,7 @@ def getRemote(self, remote):


def addServer(self, payload={}):
if payload:
if payload and payload.get('name'):
payload['online'] = True
servers = self.getDiscovery()
server = servers.get(payload.get('name'),{})
Expand All @@ -113,7 +117,7 @@ def addServer(self, payload={}):
def delServer(self):
self.log('delServer')
def _build(payload):
return LISTITEMS.buildMenuListItem(payload['name'],'%s - %s: Channels (%s)'%(LANGUAGE(32211)%({True:'green',False:'red'}[payload.get('online',False)],{True:LANGUAGE(33130),False:LANGUAGE(30129)}[payload.get('online',False)]),payload['host'],len(payload.get('channels',[]))))
return LISTITEMS.buildMenuListItem(payload.get('name'),'%s - %s: Channels (%s)'%(LANGUAGE(32211)%({True:'green',False:'red'}[payload.get('online',False)],{True:'Online',False:'Offline'}[payload.get('online',False)]),payload.get('host'),len(payload.get('channels',[]))))

with BUILTIN.busy_dialog():
servers = self.getDiscovery()
Expand All @@ -128,11 +132,8 @@ def _build(payload):

def selServer(self):
self.log('selServer')
def __chkSettings(settings):
[hasAddon(id,install=True,enable=True) for k,addons in list(settings.items()) for id in addons if id.startswith(('resource','plugin'))]

def __build(payload):
return LISTITEMS.buildMenuListItem(payload['name'],'%s - %s: Channels (%s)'%(LANGUAGE(32211)%({True:'green',False:'red'}[payload.get('online',False)],{True:LANGUAGE(33130),False:LANGUAGE(30129)}[payload.get('online',False)]),payload['host'],len(payload.get('channels',[]))))
return LISTITEMS.buildMenuListItem(payload.get('name'),'%s - %s: Channels (%s)'%(LANGUAGE(32211)%({True:'green',False:'red'}[payload.get('online',False)],{True:'Online',False:'Offline'}[payload.get('online',False)]),payload.get('host'),len(payload.get('channels',[]))))

with BUILTIN.busy_dialog():
servers = self.getDiscovery()
Expand All @@ -151,7 +152,6 @@ def __build(payload):
if not servers[liz.getLabel()].get('enabled',False):
DIALOG.notificationDialog(LANGUAGE(30099)%(liz.getLabel()))
servers[liz.getLabel()]['enabled'] = True
__chkSettings(loadJSON(servers[liz.getLabel()].get('settings')))
if not instancePath:
if SETTINGS.setPVRRemote(servers[liz.getLabel()].get('host'),liz.getLabel()): PROPERTIES.setEpochTimer('chkPVRRefresh')
else:
Expand All @@ -161,18 +161,29 @@ def __build(payload):
if instancePath: FileAccess.delete(instancePath)
return self.setDiscovery(servers)


def enableZeroConf(self):
self.log('enableZeroConf')
if SETTINGS.getSetting('ZeroConf_Status') == '[COLOR=red][B]Offline[/B][/COLOR]':
if BUILTIN.getInfoLabel('Platform.Windows','System'):
return BUILTIN.executebuiltin('RunScript(special://home/addons/plugin.video.pseudotv.live/resources/lib/utilities.py, Show_ZeroConf_QR)')
elif DIALOG.yesnoDialog(message=LANGUAGE(30129)):
if self.jsonRPC.setSettingValue("services.zeroconf","true"):
PROPERTIES.forceUpdateTime('chkKodiSettings')


def run(self):
try: param = self.sysARG[1]
except: param = None
self.log('run, param = %s'%(param))

if param == 'Select_Server':
if param == 'Enable_ZeroConf':
ctl = (5,1)
self.enableZeroConf()
elif param == 'Select_Server':
ctl = (5,11)
self.selServer()
elif param == 'Remove_server':
ctl = (5,12)
self.delServer()
return openAddonSettings(ctl)


Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _start(self):
self._httpd_thread = Thread(target=self._server.serve_forever)
self._httpd_thread.daemon=True
self._httpd_thread.start()
SETTINGS.setSetting('Remote_Status',LANGUAGE(32211)%({True:'green',False:'red'}[self.isRunning],{True:LANGUAGE(33130),False:LANGUAGE(30129)}[self.isRunning]))
SETTINGS.setSetting('Remote_Status',LANGUAGE(32211)%({True:'green',False:'red'}[self.isRunning],{True:'Online',False:'Offline'}[self.isRunning]))

except Exception as e:
self.log("_start, Failed! %s"%(e), xbmc.LOGERROR)
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 @@ -72,7 +72,7 @@ def chkInstanceID(self):
@cacheit(expiration=datetime.timedelta(days=28), checksum=1)
def chkWelcome(self):
self.log('chkWelcome')
return DIALOG.qrDialog(URL_WIKI,LANGUAGE(32216)%(ADDON_NAME))
return BUILTIN.executebuiltin('RunScript(special://home/addons/plugin.video.pseudotv.live/resources/lib/utilities.py, Show_Wiki_QR)')


def chkDebugging(self):
Expand Down Expand Up @@ -162,7 +162,7 @@ def chkKodiSettings(self):
self.log('chkKodiSettings')
if (self.jsonRPC.getSettingValue('epg.pastdaystodisplay') or 1): SETTINGS.setSettingInt('Min_Days',min)
if (self.jsonRPC.getSettingValue('epg.futuredaystodisplay') or 3): SETTINGS.setSettingInt('Max_Days',max)
SETTINGS.setSetting('ZeroConf_Status',LANGUAGE(32211)%({True:'green',False:'red'}[self.jsonRPC.getSettingValue("services.zeroconf")],{True:LANGUAGE(33130),False:LANGUAGE(30129)}[self.jsonRPC.getSettingValue("services.zeroconf")]))
SETTINGS.setSetting('ZeroConf_Status',LANGUAGE(32211)%({True:'green',False:'red'}[self.jsonRPC.getSettingValue("services.zeroconf")],{True:'Online',False:'Offline'}[self.jsonRPC.getSettingValue("services.zeroconf")]))


def chkFiles(self):
Expand Down
Loading

0 comments on commit 8fc870b

Please sign in to comment.