Skip to content

Commit

Permalink
v.0.5.4m
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Oct 2, 2024
1 parent 99c00f2 commit 81577d2
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 41 deletions.
4 changes: 1 addition & 3 deletions 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.4l" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.4m" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="21.8.0"/>
Expand All @@ -19,8 +19,6 @@
<import addon="resource.videos.adverts.pseudotv" optional="true" version="0.0.1"/>
<import addon="resource.videos.trailers.pseudotv" optional="true" version="0.0.1"/>
<import addon="resource.videos.ratings.mpaa.classic" optional="true" version="0.0.4"/>
<import addon="plugin.video.ispot.tv" optional="true" version="0.0.1"/>
<import addon="plugin.video.imdb.trailers" optional="true" version="0.0.1"/>
<import addon="script.module.youtube.dl" optional="true" version="23.04.01+matrix.1"/>
<import addon="script.module.pil" optional="true" version="5.1.0"/>
</requires>
Expand Down
2 changes: 1 addition & 1 deletion addons.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4e92103a1e9f1a27faaaa7e4c2c03d55
65901dd21e1aa538a0792700535a75d2
4 changes: 1 addition & 3 deletions 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.4l" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.4m" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="21.8.0"/>
Expand All @@ -18,8 +18,6 @@
<import addon="resource.videos.adverts.pseudotv" optional="true" version="0.0.1"/>
<import addon="resource.videos.trailers.pseudotv" optional="true" version="0.0.1"/>
<import addon="resource.videos.ratings.mpaa.classic" optional="true" version="0.0.4"/>
<import addon="plugin.video.ispot.tv" optional="true" version="0.0.1"/>
<import addon="plugin.video.imdb.trailers" optional="true" version="0.0.1"/>
<import addon="script.module.youtube.dl" optional="true" version="23.04.01+matrix.1"/>
<import addon="script.module.pil" optional="true" version="5.1.0"/>
</requires>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ msgid "Three Inserts"
msgstr ""

msgctxt "#30026"
msgid "Four Inserts"
msgid "One Inserts"
msgstr ""

msgctxt "#30027"
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ def addChannelStation(self, citem: dict) -> bool:
citem['logo'] = self.kodiImage(citem['logo'])
citem['group'] = cleanGroups(citem, self.enableGrouping)
sitem = self.m3u.getStationItem(citem)
self.m3u.addStation(sitem)
return self.xmltv.addChannel(sitem)
self.xmltv.addChannel(sitem)
return self.m3u.addStation(sitem)


def addChannelProgrammes(self, citem: dict, fileList: list):
Expand Down
12 changes: 7 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/fillers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __sortItems(data, stype='folder'):

try:
if path.startswith('resource.'):
if ftype == 'ratings': return __sortItems(_parseResource(path),'file')
if ftype == 'ratings': return __sortItems(_parseResource(path))
elif ftype == 'bumpers': return __sortItems(_parseResource(path))
elif ftype == 'adverts': return __sortItems(_parseResource(path))
elif ftype == 'trailers': return __sortItems(_parseResource(path))
Expand All @@ -111,6 +111,7 @@ def convertMPAA(self, ompaa):


def getSingle(self, type, keys=['resources'], chance=False):
self.log('getSingle, type = %s, keys = %s, chance = %s'%(type,keys,chance))
tmpLST = []
for key in keys: tmpLST.extend(self.builder.bctTypes.get(type,{}).get('items',{}).get(key.lower(),[]))
if len(tmpLST) > 0: return random.choice(tmpLST)
Expand All @@ -124,6 +125,7 @@ def getMulti(self, type, keys=['resources'], count=1, chance=False):
for key in keys: tmpLST.extend(self.builder.bctTypes.get(type,{}).get('items',{}).get(key.lower(),[]))
if len(tmpLST) > 0: items = setDictLST(random.choices(tmpLST,k=count))
if len(items) < count and chance: items.extend(self.getMulti(type,count=(count-len(items))))
self.log('getMulti, type = %s, keys = %s, count = %s, chance = %s, returning = %s'%(type,keys,count,chance,len(items)))
return items


Expand Down Expand Up @@ -155,11 +157,11 @@ def injectBCTs(self, citem, fileList):
if not item.get('duration'): continue
else:
runtime += item.get('duration')
self.log('injectBCTs, adding bumper/ratings %s - %s'%(item.get('file'),item.get('duration')))
self.log('injectBCTs, adding pre-roll %s - %s'%(item.get('file'),item.get('duration')))
if self.builder.pDialog: self.builder.pDialog = DIALOG.progressBGDialog(self.builder.pCount, self.builder.pDialog, message='Filling Pre-Rolls',header='%s, %s'%(ADDON_NAME,self.builder.pMSG))
item.update({'title':'Pre-Roll','episodetitle':item.get('label'),'genre':['Pre-Roll'],'plot':item.get('plot',item.get('file')),'path':item.get('file')})
nfileList.append(self.builder.buildCells(citem,item.get('duration'),entries=1,info=item)[0])

# original media
nfileList.append(fileItem)
self.log('injectBCTs, adding media %s - %s'%(fileItem.get('file'),fileItem.get('duration')))
Expand All @@ -177,15 +179,15 @@ def injectBCTs(self, citem, fileList):

# post roll - adverts/trailers
if len(postFileList) > 0:
self.log('injectBCTs, post roll current runtime %s, available runtime %s, available content %s'%(runtime, postFillRuntime,len(postFileList)))
self.log('injectBCTs, post-roll current runtime %s, available runtime %s, available content %s'%(runtime, postFillRuntime,len(postFileList)))
while not self.builder.service.monitor.abortRequested() and postFillRuntime > 0 and len(postFileList) > 0 and postFillCount > 0:
if self.builder.service._interrupt(): break
item = postFileList.pop(0)
if not item.get('duration'): continue
elif postFillRuntime <= 0: break
elif postFillRuntime >= item.get('duration'):
postFillRuntime -= item.get('duration')
self.log('injectBCTs, post advert/trailer %s - %s'%(item.get('file'),item.get('duration')))
self.log('injectBCTs, post-roll %s - %s'%(item.get('file'),item.get('duration')))
if self.builder.pDialog: self.builder.pDialog = DIALOG.progressBGDialog(self.builder.pCount, self.builder.pDialog, message='Filling Post-Rolls',header='%s, %s'%(ADDON_NAME,self.builder.pMSG))
item.update({'title':'Post-Roll','episodetitle':item.get('label'),'genre':['Post-Roll'],'plot':item.get('plot',item.get('file')),'path':item.get('file')})
nfileList.append(self.builder.buildCells(citem,item.get('duration'),entries=1,info=item)[0])
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def queueJSON(self, param):
queuePool['params'] = sorted(setDictLST(params), key=lambda d: d.get('params',{}).get('setting',''))
queuePool['params'].reverse() #prioritize setsetting,playcount rollback over duration amendments.
self.log("queueJSON, queueing = %s\n%s"%(len(queuePool['params']),param))
SETTINGS.setCacheSetting('queuePool', queuePool, json_data=True, force=True)
SETTINGS.setCacheSetting('queuePool', queuePool, json_data=True)


def cacheJSON(self, param, life=datetime.timedelta(minutes=15), checksum=ADDON_VERSION, timeout=15):
Expand Down Expand Up @@ -520,7 +520,7 @@ def padItems(self, files, page=SETTINGS.getSettingInt('Page_Limit')):
return files


@cacheit(expiration=datetime.timedelta(minutes=5),json_data=False)
@cacheit(expiration=datetime.timedelta(seconds=EPOCH_TIMER),json_data=False)
def getFriendlyName(self):
with PROPERTIES.suspendActivity():
fn = self.getSettingValue("services.devicename")
Expand Down
9 changes: 4 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def getSettingDict(self, key):
return loadJSON(decodeString(self.getSetting(key)))


def getCacheSetting(self, key, checksum=ADDON_VERSION, json_data=False):
def getCacheSetting(self, key, checksum=1, json_data=False):
return self.cache.get(key, checksum, json_data)

#SET
Expand Down Expand Up @@ -297,8 +297,7 @@ def setSettingDict(self, key, values):
return self.setSetting(key,encodeString(dumpJSON(values)))


def setCacheSetting(self, key, value, checksum=ADDON_VERSION, life=datetime.timedelta(days=84), json_data=False, force=False):
if force: self.cache.clear(key)
def setCacheSetting(self, key, value, checksum=1, life=datetime.timedelta(days=84), json_data=False):
return self.cache.set(key, value, checksum, life, json_data)


Expand All @@ -317,11 +316,11 @@ def setEXTSetting(self, id, key, value):


def hasAutotuned(self):
return self.getCacheSetting('hasAutotuned', checksum=1)
return self.getCacheSetting('hasAutotuned')


def setAutotuned(self, state=True):
return self.setCacheSetting('hasAutotuned', state, checksum=1)
return self.setCacheSetting('hasAutotuned', state)


def getFriendlyName(self):
Expand Down
3 changes: 1 addition & 2 deletions plugin.video.pseudotv.live/resources/lib/multiroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ def sendResponse(self, payload):
def hasServers(self, servers={}):
if not servers: servers = self.getDiscovery()
self.log('hasServers, servers = %s'%(len(servers)))
eServers = [v['name'] for v in servers.values() if v['enabled']]
SETTINGS.setSetting('Select_server','|'.join(['[COLOR=%s]%s[/COLOR]'%({True:'green',False:'red'}[v.get('online',False)],v['name']) for k, v in servers.items() if v['enabled']]))
SETTINGS.setSetting('Select_server','|'.join(['[COLOR=%s]%s[/COLOR]'%({True:'green',False:'red'}[v.get('online',False)],v.get('name')) for v in [v for v in servers.values() if v.get('enabled',False)]]))
PROPERTIES.setEXTProperty('%s.has.Servers'%(ADDON_ID),str(len(servers) > 0).lower())


Expand Down
12 changes: 6 additions & 6 deletions plugin.video.pseudotv.live/resources/lib/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def __init__(self):
self.optionDescriptions = [LANGUAGE(30045)]
self.actions = [RULES_ACTION_OVERLAY_OPEN,RULES_ACTION_OVERLAY_CLOSE]
self.selectBoxOptions = [""]
self.storedValues = [[]]
self.storedValues = [list()]


def copy(self):
Expand Down Expand Up @@ -594,7 +594,7 @@ def __init__(self):
self.optionDescriptions = [""]
self.actions = [RULES_ACTION_PLAYER_START,RULES_ACTION_PLAYER_STOP]
self.selectBoxOptions = [""]
self.storedValues = [[]]
self.storedValues = [list()]


def copy(self):
Expand Down Expand Up @@ -634,7 +634,7 @@ def __init__(self):
self.optionDescriptions = [LANGUAGE(33131)]
self.actions = [RULES_ACTION_PLAYER_START,RULES_ACTION_PLAYER_STOP]
self.selectBoxOptions = [""]
self.storedValues = [[]]
self.storedValues = [list()]


def copy(self):
Expand Down Expand Up @@ -674,7 +674,7 @@ def __init__(self):
self.optionDescriptions = [LANGUAGE(33132)]
self.actions = [RULES_ACTION_PLAYER_START,RULES_ACTION_PLAYER_STOP]
self.selectBoxOptions = [""]
self.storedValues = [[]]
self.storedValues = [list()]


def copy(self):
Expand Down Expand Up @@ -855,7 +855,7 @@ def __init__(self):
self.optionDescriptions = [""]
self.actions = [RULES_ACTION_CHANNEL_BUILD_FILEARRAY_PRE]
self.selectBoxOptions = [""]
self.storedValues = [[]]
self.storedValues = [list()]


def copy(self):
Expand Down Expand Up @@ -900,7 +900,7 @@ def runAction(self, actionid, citem, parameter, builder):
{"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=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 [fileList for fileList in self.storedValues[0]]
return parameter


Expand Down
10 changes: 5 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def chkVersion(self):
if ADDON_VERSION < ONLINE_VERSION:
update = True
DIALOG.notificationDialog('%s\nVersion: [B]%s[/B]'%(LANGUAGE(32168),ONLINE_VERSION))
elif ADDON_VERSION > (SETTINGS.getCacheSetting('lastVersion') or '0.0.0'):
SETTINGS.setCacheSetting('lastVersion',ADDON_VERSION)
elif ADDON_VERSION > (SETTINGS.getCacheSetting('lastVersion', checksum=ADDON_VERSION) or '0.0.0'):
SETTINGS.setCacheSetting('lastVersion',ADDON_VERSION, checksum=ADDON_VERSION)
BUILTIN.executebuiltin('RunScript(special://home/addons/plugin.video.pseudotv.live/resources/lib/utilities.py,Show_Changelog)')
SETTINGS.setSetting('Update_Status',{'True':'[COLOR=yellow]%s Version: [B]%s[/B][/COLOR]'%(LANGUAGE(32168),ONLINE_VERSION),'False':'None'}[str(update)])

Expand Down Expand Up @@ -235,7 +235,7 @@ def chkPVRSettings(self):
def chkDiscovery(self):
self.log('chkDiscovery')
self.multiroom.hasServers()
self.multiroom.pairDiscovery()
timerit(self.multiroom.pairDiscovery)(1.0)


def chkHTTP(self):
Expand All @@ -248,12 +248,12 @@ def chkJSONQUE(self):
with PROPERTIES.setRunning('chkJSONQUE'):
queuePool = (SETTINGS.getCacheSetting('queuePool', json_data=True) or {})
params = queuePool.get('params',[])
for param in (list(chunkLst(params,int((REAL_SETTINGS.getSetting('Page_Limit') or "25")))) or [[]])[0]:
for i in list(range(int((REAL_SETTINGS.getSetting('Page_Limit') or "25")))):
if self.service._interrupt(): break
elif len(params) > 0: self._que(self.jsonRPC.sendJSON,10,params.pop(0))
queuePool['params'] = setDictLST(params)
self.log('chkJSONQUE, remaining = %s'%(len(queuePool['params'])))
SETTINGS.setCacheSetting('queuePool', queuePool, json_data=True, force=True)
SETTINGS.setCacheSetting('queuePool', queuePool, json_data=True)


def runAutoTune(self):
Expand Down
5 changes: 2 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ def showWelcome(self):
with BUILTIN.busy_dialog():
fle = FileAccess.open(WELCOME_FLE, "r")
ftext = fle.read()
fsize = fle.size()
fle.close()

if SETTINGS.getCacheSetting('showWelcome', checksum=fsize):
SETTINGS.setCacheSetting('showWelcome', False, checksum=fsize)
if SETTINGS.getCacheSetting('showWelcome', checksum=len(ftext)):
SETTINGS.setCacheSetting('showWelcome', False, checksum=len(ftext))
DIALOG.textviewer(ftext.format(addon_name = ADDON_NAME,
pvr_name = PVR_CLIENT_NAME,
m3u = M3UFLEPATH.replace('special://profile','.'),
Expand Down
11 changes: 8 additions & 3 deletions plugin.video.pseudotv.live/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@
</setting>
<setting id="Enable_Fillers" type="boolean" label="30056" help="33056">
<level>1</level>
<default>false</default>
<default>true</default>
<control type="toggle"/>
</setting>
<setting id="Enable_Extras" type="boolean" label="30053" help="33053">
Expand Down Expand Up @@ -762,6 +762,9 @@
<options>
<option label="30022">-1</option>
<option label="30021">0</option>
<option label="30026">1</option>
<option label="30024">2</option>
<option label="30025">3</option>
</options>
</constraints>
<dependencies>
Expand Down Expand Up @@ -853,7 +856,7 @@
</setting>
<setting id="Include_Adverts_iSpot" type="boolean" label="30136" help="" parent="Resource_Adverts">
<level>2</level>
<default>true</default>
<default>false</default>
<control type="toggle"/>
<dependencies>
<dependency type="enable">
Expand Down Expand Up @@ -887,16 +890,18 @@
<control type="toggle"/>
<dependencies>
<dependency type="enable">
<condition operator="!is" setting="Enable_Postroll">0</condition>
<condition on="property" name="InfoBool">Library.HasContent(Movies)</condition>
</dependency>
</dependencies>
</setting>
<setting id="Include_Trailers_IMDB" type="boolean" label="30125" help="33125" parent="Resource_Trailers">
<level>2</level>
<default>true</default>
<default>false</default>
<control type="toggle"/>
<dependencies>
<dependency type="enable">
<condition operator="!is" setting="Enable_Postroll">0</condition>
<condition on="property" name="InfoBool">System.HasAddon(plugin.video.imdb.trailers)</condition>
</dependency>
</dependencies>
Expand Down
Binary file not shown.

0 comments on commit 81577d2

Please sign in to comment.