Skip to content

Commit

Permalink
v.0.5.5w
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Nov 13, 2024
1 parent 5d3467a commit f1bdb3c
Show file tree
Hide file tree
Showing 15 changed files with 273 additions and 196 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.5v" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.5w" 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 @@
92aa8e0f382a1660c12849dc8f85604c
10180e506aead3ea6dcb65dfb674bee9
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.5v" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.5w" 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: 2 additions & 0 deletions plugin.video.pseudotv.live/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
v.0.5.6
-Improved Vignette (W.I.P):
-Global settings added for default vignette image, zoom. Per-Channel settings available in Advanced Channel Rules.
-Improved MediaInfo support for external mediainfo.xml file parsing.
-Fixed Issue with disappearing channels from m3u.
-Tweaked Background overlay.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,18 @@ msgctxt "#30173"
msgid "Select Server"
msgstr ""

msgctxt "#30174"
msgid "Enable Vignette"
msgstr ""

msgctxt "#30175"
msgid "Vignette Image"
msgstr ""

msgctxt "#30176"
msgid "Vignette Zoom"
msgstr ""

# Skin - strings 31000 thru 31999 reserved for skins


Expand Down Expand Up @@ -1940,6 +1952,23 @@ msgctxt "#33172"
msgid "Default Channel List the Channel Manager starts with."
msgstr ""

msgctxt "#33174"
msgid "Enable Vignette"
msgstr ""

msgctxt "#33175"
msgid "Set Vignette Image"
msgstr ""

msgctxt "#33176"
msgid "Set Vignette Zoom"
msgstr ""

msgctxt "#33178"
msgid "Select Vignette Image"
msgstr ""


msgctxt "#33180"
msgid "Build Filler Template folders based on your channels."
msgstr ""
Expand Down
6 changes: 5 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/channelbug.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ def __init__(self, *args, **kwargs):
with BUILTIN.busy_dialog():
self.window = xbmcgui.Window(12005)
self.window_h, self.window_w = (self.window.getHeight() , self.window.getWidth())

# self.enableVignette = SETTINGS.getSettingBool('Enable_Vignette')
# self._vignette = xbmcgui.ControlImage(self._vinOffsetXY[0], self._vinOffsetXY[1], self.window_w, self.window_h, 'None', aspectRatio=0)
# self._vinImage = SETTINGS.getSetting('Vignette_Image')
# self._vinZoom = SETTINGS.getSettingFloat('Vignette_Zoom')
#todo add default overlay to channelbug tool.
try: self.userPOSX, self.userPOSY = literal_eval(SETTINGS.getSetting("Channel_Bug_Position_XY"))
except: self.userPOSX, self.userPOSY = (abs(int(self.window_w // 8) - self.window_w) - 128, abs(int(self.window_h // 16) - self.window_h) - 128)
self.posx, self.posy = self.userPOSX, self.userPOSY
Expand Down
3 changes: 3 additions & 0 deletions plugin.video.pseudotv.live/resources/lib/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ def compareDict(dict1,dict2,sortKey):
b = sorted(dict2, key=itemgetter(sortKey))
return a == b

def frange(start,stop,inc):
return map(lambda x: x/10.0, range(start,stop,inc))

def timeString2Seconds(string): #hh:mm:ss
try: return int(sum(x*y for x, y in zip(list(map(float, string.split(':')[::-1])), (1, 60, 3600, 86400))))
except: return -1
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def convertString2Num(value):
try: return literal_eval(value)
except Exception as e:
log("convertString2Num, failed! value = %s %s"%(value,e), xbmc.LOGERROR)
return None
return value

def encodeString(text):
base64_bytes = base64.b64encode(zlib.compress(text.encode(DEFAULT_ENCODING)))
Expand Down Expand Up @@ -1046,7 +1046,7 @@ def getInfoLabel(self, key, param='ListItem', timeout=FIFTEEN):
if monitor.waitForAbort(.0001) or timeout < 0: break
timeout -= .0001
value = xbmc.getInfoLabel('%s.%s'%(param,key))
self.log('getInfoLabel, key = %s.%s, value = %s, time = %s'%(param,key,value,(FIFTEEN-timeout)))
self.log('getInfoLabel, key = %s.%s, value = %s, wait = %s'%(param,key,value,(FIFTEEN-timeout)))
del monitor
return value

Expand Down
280 changes: 128 additions & 152 deletions plugin.video.pseudotv.live/resources/lib/overlay.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def determineLength(self, filename: str, fileitem: dict={}, jsonRPC=None)-> int
log("VFSParser: determineLength, file = %s\nitem = %s"%(filename,fileitem))
duration = (fileitem.get('resume',{}).get('total') or fileitem.get('runtime') or fileitem.get('duration') or (fileitem.get('streamdetails',{}).get('video',[]) or [{}])[0].get('duration') or 0)
if duration == 0 and not filename.lower().startswith(fileitem.get('originalpath','').lower()) and not filename.lower().startswith(tuple(self.VFSPaths)):
metadata = self.jsonRPC.sendJSON('{"jsonrpc":"2.0","method":"Files.GetFileDetails","params":{"file":"%s","media":"video","properties":["duration","runtime"]}}'%(fileitem.get('originalpath'))).get('filedetails',{})
metadata = self.jsonRPC.sendJSON({"method":"Files.GetFileDetails","params":{"file":fileitem.get('originalpath'),"media":"video","properties":["duration","runtime"]}})
duration = (metadata.get('resume',{}).get('total') or metadata.get('runtime') or metadata.get('duration') or (metadata.get('streamdetails',{}).get('video',[]) or [{}])[0].get('duration') or 0)
log("VFSParser: Duration is %s"%(duration))
return duration
20 changes: 10 additions & 10 deletions plugin.video.pseudotv.live/resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,17 @@ def playLive(self, name: str, chid: str, vid: str):
infoTag.set_resume_point({'ResumeTime':self.sysInfo['seek'],'TotalTime':(self.sysInfo['duration'] * 60)})
liz.setProperty('sysInfo',encodeString(dumpJSON(self.sysInfo)))
self.resolveURL(True, liz)
# elif not BUILTIN.getInfoBool('Playing','Player'): #-> VOD called by non-current EPG cell. (Unreliable during playback)
# url = self.sysInfo['fitem'].get('catchup-id')
# self.log('playLive, id = %s, VOD = %s'%(chid, url))
# self.sysInfo['vid'] = self.sysInfo['fitem'].get('file',url)
# DIALOG.notificationDialog(LANGUAGE(32185)%(self.sysInfo['fitem'].get('label',self.sysInfo.get('title',''))))
# timerit(BUILTIN.executebuiltin)(0.1,['PlayMedia(%s)'%(url)])
# self.resolveURL(False, xbmcgui.ListItem())
else:
DIALOG.notificationDialog(LANGUAGE(32000))
timerit(BUILTIN.executebuiltin)(0.1,['Action(stop)'])
else: #-> VOD called by non-current EPG cell. (Unreliable during playback)
url = self.sysInfo['fitem'].get('catchup-id')
self.log('playLive, id = %s, VOD = %s'%(chid, url))
self.sysInfo['vid'] = self.sysInfo['fitem'].get('file',url)
DIALOG.notificationDialog(LANGUAGE(32185)%(self.sysInfo['fitem'].get('label',self.sysInfo.get('title',''))))
timerit(BUILTIN.executebuiltin)(0.1,['PlayMedia(%s)'%(url)])
self.resolveURL(False, xbmcgui.ListItem())
# else:
# DIALOG.notificationDialog(LANGUAGE(32000))
# timerit(BUILTIN.executebuiltin)(0.1,['Action(stop)'])
# self.resolveURL(False, xbmcgui.ListItem())
#else: self.resolveURL(False, xbmcgui.ListItem())
else:#-> onChange callback from "live" or widget or channel switch (change via input not ui)
liz = xbmcgui.ListItem(name,path=vid)
Expand Down
62 changes: 36 additions & 26 deletions plugin.video.pseudotv.live/resources/lib/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def onActionSelect(self, optionindex, header=ADDON_NAME, preselect=-1, useDetail

def onActionBrowse(self, optionindex, type=0, heading=ADDON_NAME, shares='', mask='', options=[], exclude=None, useThumbs=True, treatAsFolder=False, prompt=True, multi=False, monitor=False):
log("onActionBrowse")
info = self.dialog.browseDialog(type, heading, self.optionValues[optionindex].replace('None',''), shares, mask, options, exclude, useThumbs, treatAsFolder, prompt, multi, monitor)
info = self.dialog.browseDialog(type, heading, self.optionValues[optionindex], shares, mask, options, exclude, useThumbs, treatAsFolder, prompt, multi, monitor)
if info is not None: self.optionValues[optionindex] = info


Expand Down Expand Up @@ -404,12 +404,12 @@ def __init__(self):
self.name = "Screen Vignette"
self.description = "Add Channel Overlay to create a immersive viewing experience."
self.optionLabels = ['Enable Screen Vignette','Vignette Image','Vignette Image offset']
self.optionValues = [False,'None',"(0,0)"]
self.optionValues = [SETTINGS.getSettingBool('Enable_Vignette'),SETTINGS.getSetting('Vignette_Image'),"(0,0)",SETTINGS.getSettingFloat('Vignette_Zoom')]
self.optionDescriptions = ["Show Screen Vignette","Change Vignette Image","Change Vignette Offset"]
self.actions = [RULES_ACTION_OVERLAY_OPEN,RULES_ACTION_OVERLAY_CLOSE]
self.selectBoxOptions = ["",self.optionValues[1],""]
self.storedValues = [[],[],[]]

self.selectBoxOptions = [[True,False],'','',list(frange(5,21,1))]
self.storedValues = [list() for idx in self.optionValues]

def copy(self):
return SetScreenVingette()
Expand All @@ -423,44 +423,54 @@ def getTitle(self):
def getPosition(self, optionindex):
self.dialog.notificationDialog(LANGUAGE(32020))


def getZoom(self, optionindex): #todo set zoom via utility or dialog
self.dialog.notificationDialog(LANGUAGE(32020))

def getImage(self, image='None'):
if not image is None:
self.log('getImage, In image = %s'%(image))
day = re.compile('\_Day(.*?)', re.IGNORECASE).search(image)
night = re.compile('\_Night(.*?)', re.IGNORECASE).search(image)
mytime = time.localtime()
if mytime.tm_hour < 6 or mytime.tm_hour > 18:
if day:
nImage = image.replace(day.group(),'_Night')
if FileAccess.exists(nImage): image = nImage
else:
if night:
nImage = image.replace(night.group(),'_Day')
if FileAccess.exists(nImage): image = nImage
self.log('getImage, Out image = %s'%(image))

def getImage(self, image=''):
self.log('getImage, In image = %s'%(image))
day = re.compile('\_Day(.*?)', re.IGNORECASE).search(image)
night = re.compile('\_Night(.*?)', re.IGNORECASE).search(image)
mytime = time.localtime()
if mytime.tm_hour < 6 or mytime.tm_hour > 18:
if day:
nImage = image.replace(day.group(),'_Night')
if FileAccess.exists(nImage): image = nImage
else:
if night:
nImage = image.replace(night.group(),'_Day')
if FileAccess.exists(nImage): image = nImage
self.log('getImage, Out image = %s'%(image))
return image


def onAction(self, optionindex):
if optionindex == 0: self.onActionToggleBool(optionindex)
elif optionindex == 1: self.onActionBrowse(optionindex, type=1, heading=self.optionLabels[1], mask=xbmc.getSupportedMedia('picture'), exclude=[LANGUAGE(32202),LANGUAGE(32206),LANGUAGE(32195),LANGUAGE(32193),LANGUAGE(32192),LANGUAGE(32191),LANGUAGE(32194)])
elif optionindex == 2: self.getPosition(optionindex)
elif optionindex == 3: self.getZoom(optionindex)
return self.optionValues[optionindex]


def runAction(self, actionid, citem, parameter, overlay):
if actionid == RULES_ACTION_OVERLAY_OPEN:
self.storedValues[0] = overlay.enableVignette
self.storedValues[1] = overlay._vinImage
self.storedValues[2] = (overlay._vinOffsetX,overlay._vinOffsetY)
self.storedValues[2] = overlay._vinOffsetXY
self.storedValues[3] = overlay._vinZoom

overlay._vinImage = self.getImage(self.optionValues[1])
overlay._vinOffsetX, overlay._vinOffsetY = literal_eval(self.optionValues[2])
overlay.enableVignette = self.optionValues[1]
overlay._vinImage = self.getImage(self.optionValues[1])
overlay._vinOffsetXY = literal_eval(self.optionValues[2])
overlay._vinZoom = self.optionValues[3]

elif actionid == RULES_ACTION_OVERLAY_CLOSE:
overlay._vinImage = self.storedValues[1]
overlay._vinOffsetX, overlay._vinOffsetY = self.storedValues[2]
self.log("runAction, setting overlay image to %s (%s,%s)"%(overlay._vinImage,overlay._vinOffsetX,overlay._vinOffsetY))
overlay.enableVignette = self.storedValues[0]
overlay._vinImage = self.storedValues[1]
overlay._vinOffsetXY = self.storedValues[2]
overlay._vinZoom = self.storedValues[3]
self.log("runAction, setting overlay enabled = %s, image %s @ (%s) X %s"%(overlay.enableVignette, overlay._vinImage, overlay._vinOffsetXY, overlay._vinZoom))
return parameter


Expand Down
52 changes: 52 additions & 0 deletions plugin.video.pseudotv.live/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,58 @@
<multiselect>true</multiselect>
</control>
</setting>
<setting id="Enable_Vignette" type="boolean" label="30174" help="33174" parent="Overlay_Enable">
<level>1</level>
<default>false</default>
<control type="toggle"/>
<dependencies>
<dependency type="visible">
<condition operator="is" setting="Overlay_Enable">true</condition>
</dependency>
</dependencies>
</setting>
<setting id="Vignette_Image" type="path" label="30175" help="33175" parent="Enable_Vignette">
<level>1</level>
<default>special://home/addons/resource.images.overlays.crttv/resources/exodus_Samsung_Day.png</default>
<constraints>
<sources>
<source>pictures</source>
</sources>
<writable>false</writable>
<allowempty>true</allowempty>
</constraints>
<dependencies>
<dependency type="visible">
<and>
<condition operator="is" setting="Overlay_Enable">true</condition>
<condition operator="is" setting="Enable_Vignette">true</condition>
</and>
</dependency>
</dependencies>
<control type="button" format="path">
<heading>33178</heading>
</control>
</setting>
<setting id="Vignette_Zoom" type="number" label="30176" help="33176" parent="Enable_Vignette">
<level>1</level>
<default>0.8</default>
<constraints>
<minimum>0.5</minimum>
<step>0.1</step>
<maximum>2.0</maximum>
</constraints>
<dependencies>
<dependency type="visible">
<and>
<condition operator="is" setting="Overlay_Enable">true</condition>
<condition operator="is" setting="Enable_Vignette">true</condition>
</and>
</dependency>
</dependencies>
<control type="slider" format="number">
<popup>false</popup>
</control>
</setting>
<setting id="Enable_OnNext" type="boolean" label="30045" help="33045" parent="Overlay_Enable">
<level>1</level>
<default>true</default>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<effect type="zoom" start="80" end="100" center="50%,50%" delay="160" tween="back" time="240"/>
<effect type="fade" delay="160" end="100" time="240"/>
</animation>
<visible>Control.IsVisible(40001)</visible>
<visible>[Control.IsVisible(40001)]</visible>
<description>Background !Playing</description>
<control type="group">
<description>Background Dynamic</description>
Expand All @@ -29,6 +29,7 @@
<height>auto</height>
<colordiffuse>black</colordiffuse>
<texture>colors/white.png</texture>
<visible>[!Player.Playing]</visible>
<aspectratio scalediffuse="true" align="center" aligny="center">scale</aspectratio>
</control>
<control type="image">
Expand Down
Binary file not shown.

0 comments on commit f1bdb3c

Please sign in to comment.