Skip to content

Commit

Permalink
v.0.5.6o
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Dec 7, 2024
1 parent 8a027fd commit 05ea4ca
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 62 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.6m" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.6o" 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 @@
0046eef886cd97efb8daf891ad67eb62
e676b3a888c19eafe810cd158b93d2c8
14 changes: 2 additions & 12 deletions language_report.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
Language IDS w\empty strings: {
"30047": "",
"30070": "",
"30073": "",
"30085": "",
"30127": "",
"32024": "",
"32033": "",
"32114": "",
"32197": "",
"33130": ""
}
Expand Down Expand Up @@ -92,7 +86,6 @@ Language IDS not found in py files, possibly only in xml: {
"30040": "Clear All Autotuned Channels",
"30041": "Global",
"30042": "Enable Overlay",
"30047": "",
"30048": "Overlay",
"30056": "Include Fillers",
"30057": "Playback",
Expand All @@ -108,10 +101,8 @@ Language IDS not found in py files, possibly only in xml: {
"30067": "Prefer Poster",
"30068": "Enable Nearest Holiday",
"30069": "Third-Party",
"30070": "",
"30071": "IPTV Simple Settings",
"30072": "Debugging",
"30073": "",
"30074": "Enable Automatic PVR Configurations",
"30075": "More Info",
"30076": "Play from here",
Expand All @@ -122,7 +113,6 @@ Language IDS not found in py files, possibly only in xml: {
"30082": "12 Hours",
"30083": "24 Hours",
"30084": "Disable Cache while Debugging",
"30085": "",
"30087": "Browse",
"30088": "Documents",
"30089": "Show Readme",
Expand Down Expand Up @@ -184,7 +174,7 @@ Language IDS not found in py files, possibly only in xml: {
"32012": "Recommended",
"32013": "Services",
"32024": "",
"32033": "",
"32033": "Offline",
"32048": "Select Servers",
"32049": "Restarting...",
"32053": "Settings",
Expand All @@ -194,7 +184,7 @@ Language IDS not found in py files, possibly only in xml: {
"32075": "Saving...",
"32082": "Clear this Channels Configurations",
"32113": "Recovering Channel",
"32114": "",
"32114": "Online",
"32115": "Running as a client.",
"32130": "[COLOR=red][B]Warning!! [/B][/COLOR]File caching disabled\\nIt's recommended you re-enable when finished debugging",
"32133": "[COLOR=yellow][B]Notice!! [/B][/COLOR] Something went wrong, Please double check your PVR configurations and reboot Kodi.",
Expand Down
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.6m" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.6o" 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
3 changes: 2 additions & 1 deletion plugin.video.pseudotv.live/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
v.0.5.7
-Fixed PseudoTV not respecting user subtitle preference.
-Fixed Channel bug and On-Next position not changing based on user settings.
-Improved Background Interface.
-Improved Background Interface and content transitioning.
-Fixed Deadlocking issue when checking multi-room status on startup.
-Improved URL caching.
-Added Experimental new adv. channel rule "Pause Channel". The rule pauses channel content when not viewing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ msgid "Remove Server"
msgstr ""

msgctxt "#30047"
msgid ""
msgid "Strms"
msgstr ""

msgctxt "#30048"
Expand Down Expand Up @@ -298,7 +298,7 @@ msgid "Third-Party"
msgstr ""

msgctxt "#30070"
msgid ""
msgid "Clearing %s Cache"
msgstr ""

msgctxt "#30071"
Expand All @@ -310,7 +310,7 @@ msgid "Debugging"
msgstr ""

msgctxt "#30073"
msgid ""
msgid "%s\nVersion: [B]%s[/B]"
msgstr ""

msgctxt "#30074"
Expand Down Expand Up @@ -358,7 +358,7 @@ msgid "Disable Cache while Debugging"
msgstr ""

msgctxt "#30085"
msgid ""
msgid "Channels updated by %s"
msgstr ""

msgctxt "#30086"
Expand Down Expand Up @@ -928,7 +928,7 @@ msgid "No Duration Found!"
msgstr ""

msgctxt "#32033"
msgid ""
msgid "Offline"
msgstr ""

msgctxt "#32034"
Expand Down Expand Up @@ -1252,7 +1252,7 @@ msgid "Recovering Channel"
msgstr ""

msgctxt "#32114"
msgid ""
msgid "Online"
msgstr ""

msgctxt "#32115"
Expand Down
2 changes: 0 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/fileaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class FileAccess:
@staticmethod
def open(filename, mode, encoding=DEFAULT_ENCODING):
fle = 0
log("FileAccess: trying to open %s"%filename)
try: return VFSFile(filename, mode)
except UnicodeDecodeError: return FileAccess.open(filename, mode, encoding)
return fle
Expand Down Expand Up @@ -204,7 +203,6 @@ def _makedirs(path):

class VFSFile:
def __init__(self, filename, mode):
log("VFSFile: trying to open %s"%filename)
if mode == 'w':
if not FileAccess.exists(filename):
FileAccess.makedirs(os.path.split(filename)[0])
Expand Down
7 changes: 4 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def inputFriendlyName(self):


def getCallback(self, sysInfo={}):
self.log('getCallback, id = %s, radio = %s, isPlaylist = %s'%(sysInfo.get('chid'),sysInfo.get('radio',False),sysInfo.get('isPlaylist',False)))
self.log('getCallback, id = %s, mode = %s, radio = %s, isPlaylist = %s'%(sysInfo.get('chid'),sysInfo.get('mode'),sysInfo.get('radio',False),sysInfo.get('isPlaylist',False)))
def _matchJSON():#requires 'pvr://' json whitelisting.
results = self.getDirectory(param={"directory":"pvr://channels/{dir}/".format(dir={'True':'radio','False':'tv'}[str(sysInfo.get('radio',False))])}, cache=False).get('files',[])
for dir in [ADDON_NAME,'All channels']: #todo "All channels" may not work with non-English translations!
Expand All @@ -572,13 +572,14 @@ def _matchJSON():#requires 'pvr://' json whitelisting.
if item.get('label','').lower() == sysInfo.get('name','').lower() and decodePlot(item.get('plot','')).get('citem',{}).get('id') == sysInfo.get('chid'):
self.log('getCallback: _matchJSON, id = %s, found file = %s'%(sysInfo.get('chid'),item.get('file')))
return item.get('file')

if sysInfo.get('mode','').lower() == 'live' and sysInfo.get('chpath'):
callback = sysInfo.get('chpath')
elif sysInfo.get('isPlaylist'):
callback = sysInfo.get('citem',{}).get('url')
else:
callback = _matchJSON()
callback = sysInfo.get('callback','')
if not callback: callback = _matchJSON()
self.log('getCallback: returning callback = %s'%(callback))
return callback

Expand Down
10 changes: 5 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ def __getMeta(payload):
xmltv = XMLTVS()
payload.pop('updated')
payload.pop('md5')
payload['library'] = Library().getLibrary()
payload['m3u'] = M3U().getM3U()
payload['xmltv'] = {'stations':xmltv.getChannels(), 'recordings':xmltv.getRecordings(), 'programmes':dict([(key,datetime.datetime.fromtimestamp(time.time()).strftime(DTFORMAT)) for key, value in list(dict(xmltv.loadStopTimes()).items())])}
payload['xmltv'] = {'stations':xmltv.getChannels(), 'recordings':xmltv.getRecordings(), 'programmes':[{'id':key,'end-time':datetime.datetime.fromtimestamp(time.time()).strftime(DTFORMAT)} for key, value in list(dict(xmltv.loadStopTimes()).items())]}
payload['library'] = Library().getLibrary()
payload['servers'] = Multiroom().getDiscovery()
del xmltv
return payload
Expand Down Expand Up @@ -834,7 +834,7 @@ def clearProperty(self, key):
#GET
def getEXTProperty(self, key):
value = xbmcgui.Window(10000).getProperty(key)
self.log('getEXTProperty, id = %s, key = %s, value = %s'%(10000,key,'%s...'%(str(value)[:128])))
if not '.TRASH' in key: self.log('getEXTProperty, id = %s, key = %s, value = %s'%(10000,key,'%s...'%(str(value)[:128])))
return value


Expand Down Expand Up @@ -871,7 +871,7 @@ def getPropertyFloat(self, key, default=-1):

#SET
def setEXTProperty(self, key, value):
self.log('setEXTProperty, id = %s, key = %s, value = %s'%(10000,key,'%s...'%((str(value)[:128]))))
if not '.TRASH' in key: self.log('setEXTProperty, id = %s, key = %s, value = %s'%(10000,key,'%s...'%((str(value)[:128]))))
xbmcgui.Window(10000).setProperty(key,str(value))
return value

Expand Down Expand Up @@ -1363,7 +1363,7 @@ def importSTRM(self, strm):
fle = FileAccess.open(strm,'r')
paths = [line for line in fle.readlines() if not line.startswith('#') and '://' in line]
fle.close()
if len(paths) == 0: return self.notificationDialog(LANGUAGE(32018)%("Strms"))
if len(paths) == 0: return self.notificationDialog(LANGUAGE(32018)%(LANGUAGE(30047)))
select = self.selectDialog(paths, LANGUAGE(32080), useDetails=False, multi=False)
self.log("importSTRM, strm = %s paths = %s"%(strm,paths))
if not select is None: return paths[select]
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def updateLibrary(self, force: bool=False) -> bool:
def __clear():
for label, func in list(self.libraryFUNCS.items()):
cacheName = "%s.%s"%(self.__class__.__name__,func.__name__)
DIALOG.notificationDialog('Clearing %s Cache'%(label),time=5)
DIALOG.notificationDialog(LANGUAGE(30070)%(label),time=5)
self.cache.clear(cacheName,wait=5)

def __update(type, item):
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/multiroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def getRemote(self, remote):


def addServer(self, payload={}):
self.log('addServer, payload = %s'%(payload))
self.log('addServer, name = %s'%(payload.get('name')))
if payload and payload.get('name'):
payload['online'] = True
servers = self.getDiscovery()
Expand Down
12 changes: 9 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,20 @@ def log(self, msg, level=xbmc.LOGDEBUG):
def show(self):
self.log('show, id = %s, rules = %s'%(self.player.sysInfo.get('citem',{}).get('id'),self.player.sysInfo.get('rules',{})))
self.runActions(RULES_ACTION_OVERLAY_OPEN, self.player.sysInfo.get('citem',{}), inherited=self)
self.toggleVignette(), self.toggleOnNext(), self.toggleBug()
self.toggleVignette()
self.toggleOnNext()
self.toggleBug()


def close(self):
self.log('close')
self.runActions(RULES_ACTION_OVERLAY_CLOSE, self.player.sysInfo.get('citem',{}), inherited=self)
self.toggleVignette(False), self._cancelOnNext(), self._cancelBug()
for control, visible in list(self.controlManager.items()): self._removeControl(control)
self.toggleVignette(False)
self._cancelOnNext()
self._cancelBug()

for control, visible in list(self.controlManager.items()):
self._removeControl(control)


def _hasControl(self, control):
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ def __init__(self):
self.optionLabels = [LANGUAGE(30049),LANGUAGE(30052),"Minimum Duration"]
self.optionValues = [SETTINGS.getSettingInt('Duration_Type'),SETTINGS.getSettingBool('Store_Duration'),SETTINGS.getSettingInt('Seek_Tolerance')]
self.optionDescriptions = [LANGUAGE(33015),LANGUAGE(33049),LANGUAGE(33052),"Minimum Duration"]
self.actions = [RULES_ACTION_CHANNEL_START,RULES_ACTION_CHANNEL_STOP,RULES_ACTION_PLAYER_START,RULES_ACTION_PLAYER_STOP]
self.actions = [RULES_ACTION_CHANNEL_START,RULES_ACTION_CHANNEL_STOP]
self.selectBoxOptions = [{LANGUAGE(30050):0,LANGUAGE(30051):1},[],list(range(0,605,5))]
self.storedValues = [[],[],[]]

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 @@ -133,7 +133,7 @@ def _verifyUUID(uuid):
channels = list(Channels()._verify(incoming))
self.log('do_POST incoming verified channels = %s'%(len(channels)))
# if myChannels.setChannels(self.rfile.read(int(self.headers['content-length']))):
DIALOG.notificationDialog('Channels updated by %s'%(incoming.get('name',ADDON_NAME)))
DIALOG.notificationDialog(LANGUAGE(30085)%(incoming.get('name',ADDON_NAME)))
return self.send_response(200, "OK")
else: self.send_error(401, "Not found")
return self.send_error(401, "Not verified")
Expand Down
33 changes: 14 additions & 19 deletions plugin.video.pseudotv.live/resources/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@

class Player(xbmc.Player):
sysInfo = {}
isIdle = False
isPseudoTV = False
lastSubState = False
pendingStop = False
isIdle = False
lastSubState = False
restart = None
minDuration = None
accurateDuration = None
rules = RulesList()
runActions = rules.runActions

Expand Down Expand Up @@ -61,7 +59,6 @@ def log(self, msg, level=xbmc.LOGDEBUG):


def updateGlobals(self):
self.lastSubState = BUILTIN.isSubtitle()
self.enableOverlay = SETTINGS.getSettingBool('Overlay_Enable')
self.infoOnChange = SETTINGS.getSettingBool('Enable_OnInfo')
self.disableTrakt = SETTINGS.getSettingBool('Disable_Trakt')
Expand All @@ -72,7 +69,8 @@ def updateGlobals(self):


def onPlayBackStarted(self):
self.pendingStop = True
self.pendingStop = True
self.lastSubState = BUILTIN.isSubtitle()
self.log('onPlayBackStarted, pendingStop = %s'%(self.pendingStop))


Expand Down Expand Up @@ -291,7 +289,6 @@ def toggleRestart(self, state: bool=True):
class Monitor(xbmc.Monitor):
idleTime = 0
isIdle = False
isPlaying = False
overlay = None

def __init__(self, service=None):
Expand All @@ -317,13 +314,6 @@ def getIdle(self):


def chkIdle(self):
def __chkBackground():
if not self.overlay is None:
remanTime = abs(floor(self.service.player.getRemainingTime()))
if self.overlay.background is None and remanTime <= 2:
self.log('__chkBackground, toggleBackground remaining playback = %s'%(remanTime))
self.overlay.toggleBackground()

def __chkResumeTime():
if self.service.player.sysInfo.get('isPlaylist',False):
file = self.service.player.getPlayingFile()
Expand All @@ -336,21 +326,27 @@ def __chkSleepTimer():
self.log('__chkSleepTimer, sleepTime = %s'%(self.service.player.sleepTime))
self.triggerSleep()

def __chkBackground():
if not self.overlay is None:
remanTime = abs(floor(self.service.player.getRemainingTime()))
if self.overlay.background is None and remanTime <= 2:
self.log('__chkBackground, toggleBackground remaining playback = %s'%(remanTime))
self.overlay.toggleBackground()

self.isIdle, self.idleTime = self.getIdle()
if SETTINGS.getSettingBool('Debug_Enable'): self.log('chkIdle, isIdle = %s, idleTime = %s'%(self.isIdle, self.idleTime))
if self.service.player.isPseudoTV:
self.isPlaying = self.service.player.isPlaying()
if self.isPlaying:
__chkBackground()
if self.service.player.isPlaying():
__chkResumeTime()
__chkSleepTimer()
__chkBackground()
if self.isIdle: self.toggleOverlay(True)
else: self.toggleOverlay(False)


def toggleOverlay(self, state: bool=True):
if state and self.service.player.enableOverlay:
if self.overlay is None and self.isPlaying:
if self.overlay is None and self.service.player.isPlaying():
self.log("toggleOverlay, state = %s"%(state))
self.overlay = Overlay(jsonRPC=self.jsonRPC,player=self.service.player)
self.overlay.show()
Expand Down Expand Up @@ -468,7 +464,6 @@ def _suspend(self) -> bool: #continue


def __tasks(self):
if SETTINGS.getSettingBool('Debug_Enable'): self.log('__tasks')
self.tasks._chkEpochTimer('chkQueTimer',self.tasks._chkQueTimer,FIFTEEN)


Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def chkVersion(self):
ONLINE_VERSION = self.getOnlineVersion()
if ADDON_VERSION < ONLINE_VERSION:
update = True
DIALOG.notificationDialog('%s\nVersion: [B]%s[/B]'%(LANGUAGE(32168),ONLINE_VERSION))
DIALOG.notificationDialog(LANGUAGE(30073)%(LANGUAGE(32168),ONLINE_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)')
Expand Down
Loading

0 comments on commit 05ea4ca

Please sign in to comment.