Skip to content

Commit

Permalink
v.0.5.6a
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Nov 22, 2024
1 parent 3549356 commit e0c7c45
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 339 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ PseudoTV Live transforms your Kodi Library and Sources (Plugins, UPnP, etc...) i

[Changelog](https://github.com/PseudoTV/PseudoTV_Live/raw/master/plugin.video.pseudotv.live/changelog.txt)

[Forum: Kodi.TV](https://forum.kodi.tv/showthread.php?tid=355549)
[Wiki: Github](https://github.com/PseudoTV/PseudoTV_Live/wiki)

[Discussion: Kodi.TV](https://forum.kodi.tv/showthread.php?tid=346803)
[Forum: Kodi](https://forum.kodi.tv/showthread.php?tid=355549)

[Discussion: Kodi](https://forum.kodi.tv/showthread.php?tid=346803)

[Discussion: Github](https://github.com/PseudoTV/PseudoTV_Live/discussions)

[![PseudoTV Live](https://opengraph.githubassets.com/b515e27858c045536f54116a571f79bda90cde077f4a9e87af8908cb0801b6a2/PseudoTV/PseudoTV_Live)](https://opengraph.githubassets.com/b515e27858c045536f54116a571f79bda90cde077f4a9e87af8908cb0801b6a2/PseudoTV/PseudoTV_Live)

Expand Down
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.6" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.6a" 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 @@
7a4d003244773d8638ea8bc5a1161f90
5ec6e6d6294a87bb7069f710fc823b41
302 changes: 9 additions & 293 deletions plugin.video.pseudotv.live/README.md

Large diffs are not rendered by default.

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.6" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.6a" 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 @@ -182,7 +182,7 @@ msgid "Clear All Autotuned Channels"
msgstr ""

msgctxt "#30041"
msgid "Globals"
msgid "Global"
msgstr ""

msgctxt "#30042"
Expand Down Expand Up @@ -738,7 +738,7 @@ msgid "Vignette Offset"
msgstr ""

msgctxt "#30179"
msgid "Interleave Sets"
msgid "Interleave set value"
msgstr ""

msgctxt "#30180"
Expand Down
8 changes: 3 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def __chkEvenDistro(citem):
return citem
return __chkEvenDistro(citem)

citem = _injectRules(citem) #inject global adv. rules here
citem = _injectRules(citem) #inject temporary global adv. rules here
fileArray = self.runActions(RULES_ACTION_CHANNEL_BUILD_FILEARRAY_PRE, citem, list(), inherited=self)
if not _validFileList(fileArray):
paths = citem.get('path',[])
Expand All @@ -266,10 +266,8 @@ def __chkEvenDistro(citem):
return False

self.log("buildChannel, [%s] fileArray arrays = %s"%(citem['id'],len(fileArray)))
if bool(self.interleaveValue): fileList = interleave(fileArray, self.interleaveValue) #todo move intervleaving to adv. rules. RULES_ACTION_CHANNEL_BUILD_FILELIST
else: fileList = chain(*fileArray)
#Primary rule for handling adv. interleaving, must return single list to avoid default interleave() below. Add avd. rule to setDictLST duplicates.
fileList = self.runActions(RULES_ACTION_CHANNEL_BUILD_FILELIST, citem, fileList, inherited=self)
fileList = self.runActions(RULES_ACTION_CHANNEL_BUILD_FILELIST, citem, interleave(fileArray, self.interleaveValue), inherited=self)
self.log('buildChannel, [%s] fileList items = %s'%(citem['id'],len(fileList)),xbmc.LOGINFO)
return fileList

Expand All @@ -278,7 +276,7 @@ def buildFileList(self, citem: dict, path: str, media: str='video', limit: int=S
self.log("buildFileList, [%s] media = %s, path = %s\nlimit = %s, sort = %s limits = %s"%(citem['id'],media,path,limit,sort,limits))
if path.endswith('.xsp'): #smartplaylist - parse xsp for path, filter and sort info
paths, media, sort, filter, limit = self.xsp.parseXSP(path, media, sort, {}, limit)
if len(paths) > 0: return interleave([self.buildFileList(citem, file, media, limit, sort, limits) for file in paths])
if len(paths) > 0: return interleave([self.buildFileList(citem, file, media, limit, sort, limits) for file in paths], self.interleaveValue)

elif 'db://' in path and '?xsp=' in path: #dynamicplaylist - parse xsp for path, filter and sort info
path, media, sort, filter = self.xsp.parseDXSP(path, sort, {}, self.incExtras) #todo filter adv. rules.
Expand Down
12 changes: 7 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,14 @@ def roundupDIV(p, q):
def interleave(seqs, sets=1):
#evenly interleave multi-lists of different sizes, while preserving seq order and by sets of x
# In [[1,2,3,4,5],['a','b','c','d'],['A','B','C','D','E']]
# Out sets=1 [1, 'a', 'A', 2, 'b', 'B', 3, 'c', 'C', 4, 'd', 'D', 5, 'E']
# Out sets=4 [1, 2, 3, 4, 'a', 'b', 'c', 'd', 'A', 'B', 'C', 'D', 5, 'E']
seqs = [list(zip_longest(*[iter(seqs)] * sets, fillvalue=None)) for seqs in seqs]
return list(filter(None,sum([_f for _f in chain.from_iterable(zip_longest(*seqs)) if _f], ())))
# Out sets=0 [1, 2, 3, 4, 5, 'a', 'b', 'c', 'd', 'A', 'B', 'C', 'D', 'E']
# Out sets=1 [1, 'a', 'A', 2, 'b', 'B', 3, 'c', 'C', 4, 'd', 'D', 5, 'E']
# Out sets=2 [1, 2, 'a', 'b', 'A', 'B', 3, 4, 'c', 'd', 'C', 'D', 5, 'E']
if sets > 0:
seqs = [list(zip_longest(*[iter(seqs)] * sets, fillvalue=None)) for seqs in seqs]
return list(filter(None,sum([_f for _f in chain.from_iterable(zip_longest(*seqs)) if _f], ())))
else: return list(chain.from_iterable(seqs))


def percentDiff(org, new):
try: return (abs(float(org) - float(new)) / float(new)) * 100.0
except ZeroDivisionError: return -1
Expand Down
6 changes: 3 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,16 @@ def getMixedGenres(self):


def getMixed(self):
def hasRecordings():
return self.jsonRPC.walkListDirectory('pvr://recordings/tv/active/',appendPath=True) #todo add infobool to Kodi core.
def __hasRecordings():
return self.jsonRPC.walkListDirectory('pvr://recordings/tv/active/',appendPath=True)

MixedList = []
if BUILTIN.hasTV() or BUILTIN.hasMovie():
MixedList.append({'name':LANGUAGE(32001), 'type':"Mixed",'path':self.predefined.createMixedRecent() ,'logo':self.resources.getLogo(LANGUAGE(32001),"Mixed")}) #"Recently Added"
rules = {"800":{"values":{"0":LANGUAGE(32002)}}}
MixedList.append({'name':LANGUAGE(32002), 'type':"Mixed",'path':self.predefined.createSeasonal() ,'logo':self.resources.getLogo(LANGUAGE(32002),"Mixed"),'rules':rules}) #"Seasonal"

# if hasRecordings(): #broken paths no longer play, Kodi jsonrpc doesn't return valid file and uses unknown vfs assignment
# if __hasRecordings(): #broken paths no longer play, Kodi jsonrpc doesn't return valid file and uses unknown vfs assignment
# MixedList.append({'name':LANGUAGE(32003), 'type':"Mixed",'path':self.predefined.createPVRRecordings(),'logo':self.resources.getLogo(LANGUAGE(32003),"Mixed")}) #"PVR Recordings"

self.log('getMixed, mixed = %s' % (len(MixedList)))
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def buildfItem(item: dict={}):

with BUILTIN.busy_dialog():
jsonRPC = JSONRPC()
fileList = interleave([jsonRPC.requestList({'id':chid}, path, 'music', page=RADIO_ITEM_LIMIT, sort={"method":"random"})[0] for path in vid.split('|')])
fileList = interleave([jsonRPC.requestList({'id':chid}, path, 'music', page=RADIO_ITEM_LIMIT, sort={"method":"random"})[0] for path in vid.split('|')], SETTINGS.getSettingInt('Interleave_Value'))
del jsonRPC

if len(fileList) > 0:
Expand Down
20 changes: 10 additions & 10 deletions plugin.video.pseudotv.live/resources/lib/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ def __init__(self):
self.optionValues = [SETTINGS.getSettingInt('Interleave_Value')]
self.optionDescriptions = [LANGUAGE(33233)]
self.actions = [RULES_ACTION_CHANNEL_START,RULES_ACTION_CHANNEL_STOP]
self.selectBoxOptions = [list(range(1,26,1))]
self.selectBoxOptions = [list(range(0,26,1))]
self.storedValues = [[]]


Expand Down Expand Up @@ -1179,11 +1179,11 @@ def __init__(self):
self.name = LANGUAGE(30181)
self.description = LANGUAGE(33230)
self.optionLabels = [LANGUAGE(30181),LANGUAGE(30183)]
self.optionValues = [False,True]
self.optionDescriptions = ["",""]
self.optionValues = [False,SETTINGS.getSettingInt('Interleave_Value')]
self.optionDescriptions = ["",LANGUAGE(33215)]
self.actions = [RULES_ACTION_CHANNEL_BUILD_FILEARRAY_PRE,RULES_ACTION_CHANNEL_BUILD_PATH,RULES_ACTION_CHANNEL_BUILD_FILELIST]
self.storedValues = [{},{},[],[],[]]

self.storedValues = [{},{},[],[],[],[]]
self.selectBoxOptions = ["",list(range(0,26,1))]

def copy(self):
return ForceEpisode()
Expand All @@ -1194,7 +1194,8 @@ def getTitle(self):


def onAction(self, optionindex):
self.onActionToggleBool(optionindex)
if optionindex == 0: self.onActionToggleBool(optionindex)
elif optionindex == 1: self.onActionSelect(optionindex)
return self.optionValues[optionindex]


Expand Down Expand Up @@ -1243,8 +1244,7 @@ def runAction(self, actionid, citem, parameter, builder):
builder.sort = self.storedValues[0]
self.log("runAction, restoring sort and forcing episode/year ordering (%s)"%(len(parameter)))
fileList = list(sorted(parameter, key=lambda k: k.get('year',0)))
if self.optionValues[1]: return interleave(list(self._sortShows(fileList)))
else: return [j for i in self._sortShows(fileList) for j in i]
return interleave(list(self._sortShows(fileList)),self.optionValues[1])
return parameter


Expand Down Expand Up @@ -1378,8 +1378,8 @@ def runAction(self, actionid, citem, parameter, builder):
return self._mergeShows(*(self._sortShows(fileItems)))

elif actionid == RULES_ACTION_CHANNEL_BUILD_FILEARRAY_POST:
builder.enableEvenDistro = bool(SETTINGS.getSettingInt('Enable_Even')) #_injectedRules don't retain stored values
builder.limit = SETTINGS.getSettingInt('Page_Limit') #_injectedRules don't retain stored values
builder.enableEvenDistro = bool(SETTINGS.getSettingInt('Enable_Even')) #_injectedRules don't retain stored values use globals
builder.limit = SETTINGS.getSettingInt('Page_Limit') #_injectedRules don't retain stored values use globals
self.log('runAction, enableEvenDistro = %s, restoring limit = %s'%(builder.enableEvenDistro,builder.limit))
return parameter

Expand Down
6 changes: 6 additions & 0 deletions plugin.video.pseudotv.live/resources/lib/videoparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
EXTERNAL_PARSER.append(MoviePY.MoviePY)
except: pass

try:
import ffmpeg
from parsers import FFProbe
EXTERNAL_PARSER.append(FFProbe.FFProbe)
except: pass

class VideoParser:
def __init__(self):
self.AVIExts = ['.avi']
Expand Down
30 changes: 15 additions & 15 deletions plugin.video.pseudotv.live/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
<control type="spinner" format="string"/>
</setting>
<setting id="Enable_Recommended" type="boolean" label="30105" help="33105">
<level>1</level>
<level>2</level>
<default>true</default>
<control type="toggle"/>
</setting>
Expand All @@ -453,17 +453,17 @@
</dependencies>
</setting>
<setting id="Clean_Recordings" type="boolean" label="30149" help="33148">
<level>2</level>
<level>3</level>
<default>true</default>
<control type="toggle"/>
</setting>
<setting id="Enable_Grouping" type="boolean" label="30063" help="33063">
<level>1</level>
<level>2</level>
<default>true</default>
<control type="toggle"/>
</setting>
<setting id="User_Groups" type="string" label="30064" help="33064" parent="Enable_Grouping">
<level>1</level>
<level>2</level>
<default/>
<constraints>
<allowempty>true</allowempty>
Expand Down Expand Up @@ -586,7 +586,7 @@
</control>
</setting>
<setting id="Enable_Vignette" type="boolean" label="30174" help="33174" parent="Overlay_Enable">
<level>1</level>
<level>2</level>
<default>false</default>
<control type="toggle"/>
<dependencies>
Expand All @@ -596,7 +596,7 @@
</dependencies>
</setting>
<setting id="Vignette_Image" type="path" label="30175" help="33175" parent="Enable_Vignette">
<level>1</level>
<level>2</level>
<default>special://home/addons/plugin.video.pseudotv.live/resources/skins/default/media/overlays/scanlines.png</default>
<constraints>
<sources>
Expand All @@ -618,7 +618,7 @@
</control>
</setting>
<setting id="Vignette_Zoom" type="number" label="30176" help="33176" parent="Enable_Vignette">
<level>1</level>
<level>3</level>
<default>1.0</default>
<constraints>
<minimum>0.5</minimum>
Expand Down Expand Up @@ -662,7 +662,7 @@
<control type="toggle"/>
</setting>
<setting id="Restart_Percentage" type="integer" label="30153" help="33153" parent="Overlay_Enable">
<level>1</level>
<level>2</level>
<default>85</default>
<constraints>
<minimum>25</minimum>
Expand Down Expand Up @@ -691,7 +691,7 @@
<control type="toggle"/>
</setting>
<setting id="DIFFUSE_LOGO" type="string" label="30044" help="33044" parent="Enable_ChannelBug">
<level>1</level>
<level>2</level>
<default>FFFFFFFF</default>
<control type="colorbutton"/>
<dependencies>
Expand All @@ -707,7 +707,7 @@
</dependencies>
</setting>
<setting id="Force_Diffuse" type="boolean" label="30113" help="33111" parent="DIFFUSE_LOGO">
<level>1</level>
<level>3</level>
<default>false</default>
<dependencies>
<dependency type="visible">
Expand All @@ -720,7 +720,7 @@
<control type="toggle"/>
</setting>
<setting id="Channel_Bug_Interval" type="integer" label="30086" help="33086" parent="Enable_ChannelBug">
<level>1</level>
<level>2</level>
<default>0</default>
<dependencies>
<dependency type="visible">
Expand Down Expand Up @@ -820,7 +820,7 @@
<control type="toggle"/>
</setting>
<setting id="Interleave_Value" type="integer" label="30179" help="33215">
<level>1</level>
<level>3</level>
<default>1</default>
<constraints>
<minimum>0</minimum>
Expand All @@ -832,7 +832,7 @@
</control>
</setting>
<setting id="Enable_Even" type="integer" label="30121" help="33121">
<level>1</level>
<level>2</level>
<default>3</default>
<constraints>
<minimum>0</minimum>
Expand All @@ -844,7 +844,7 @@
</control>
</setting>
<setting id="Enable_Even_Force" type="boolean" label="30181" help="33230" parent="Enable_Even">
<level>1</level>
<level>2</level>
<default>false</default>
<dependencies>
<dependency type="visible">
Expand Down Expand Up @@ -1146,7 +1146,7 @@
</control>
</setting>
<setting id="Select_server" type="string" label="32048" help="33048" parent="ZeroConf_Status">
<level>0</level>
<level>2</level>
<default/>
<constraints>
<allowempty>true</allowempty>
Expand Down
Binary file not shown.

0 comments on commit e0c7c45

Please sign in to comment.