Skip to content

Commit

Permalink
v.0.5.3h
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Sep 4, 2024
1 parent ef9793a commit e22cb03
Show file tree
Hide file tree
Showing 27 changed files with 338 additions and 119 deletions.
14 changes: 11 additions & 3 deletions addons.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addons>
<addon id="plugin.video.pseudotv.live" version="0.5.3g" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.3h" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="21.8.0"/>
<import addon="script.module.six" version="1.0.0"/>
<import addon="script.module.kodi-six" version="0.1.3.1"/>
<import addon="script.module.infotagger" version="0.0.5" />
<import addon="script.module.simplecache" version="1.0.0"/>
<import addon="script.module.requests" version="0.0.1" />
<import addon="plugin.library.node.editor" version="0.0.1" />
<import addon="resource.images.studios.white" version="0.0.1"/>
<import addon="resource.images.musicgenreicons.text" version="0.0.1"/>
Expand All @@ -29,14 +30,16 @@
<extension point="xbmc.service" library="resources/lib/service.py"/>
<extension point="xbmc.python.module" library="resources/lib/"/>
<extension point="kodi.context.item">
<menu id="kodi.core.main">
<menu id="kodi.core.main">
<menu>
<label>PseudoTV Live</label>
<item library="resources/lib/context_record.py" args="add">
<label>30115</label>
<visible>[String.Contains(ListItem.Plot,"item=") + ListItem.HasEpg] + [Window.IsVisible(tvguide)|Window.IsVisible(tvsearch)|Window.IsVisible(tvchannels)]</visible>
</item>
<item library="resources/lib/context_record.py" args="del">
<label>30117</label>
<visible>[String.Contains(ListItem.PVRInstanceName, PseudoTV Live) + Window.IsVisible(tvrecordings)]</visible>
<visible>[String.StartsWith(ListItem.PVRInstanceName, PseudoTV Live) + Window.IsVisible(tvrecordings)]</visible>
</item>
<item library="resources/lib/context_play.py" args="playlist">
<label>30076</label>
Expand All @@ -58,7 +61,12 @@
<label>30114</label>
<visible>[!ListItem.IsPlayable + ListItem.IsFolder] + [!String.IsEmpty(ListItem.Label)]</visible>
</item>
<item library="resources/lib/context_create.py" args="manage">
<label>30107</label>
<visible>[String.Contains(ListItem.Plot,"item=")] + [Window.IsVisible(tvchannels)]</visible>
</item>
</menu>
</menu>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">PseudoTV Live acts like a set-top box for Kodi!</summary>
Expand Down
2 changes: 1 addition & 1 deletion addons.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0a5cfaff5c3184e4b9a7644a13af146c
afbf1ed9c6544c544ce7b37b56450635
14 changes: 11 additions & 3 deletions plugin.video.pseudotv.live/addon.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.pseudotv.live" version="0.5.3g" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.3h" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="21.8.0"/>
<import addon="script.module.six" version="1.0.0"/>
<import addon="script.module.kodi-six" version="0.1.3.1"/>
<import addon="script.module.infotagger" version="0.0.5" />
<import addon="script.module.simplecache" version="1.0.0"/>
<import addon="script.module.requests" version="0.0.1" />
<import addon="plugin.library.node.editor" version="0.0.1" />
<import addon="resource.images.studios.white" version="0.0.1"/>
<import addon="resource.images.musicgenreicons.text" version="0.0.1"/>
Expand All @@ -28,14 +29,16 @@
<extension point="xbmc.service" library="resources/lib/service.py"/>
<extension point="xbmc.python.module" library="resources/lib/"/>
<extension point="kodi.context.item">
<menu id="kodi.core.main">
<menu id="kodi.core.main">
<menu>
<label>PseudoTV Live</label>
<item library="resources/lib/context_record.py" args="add">
<label>30115</label>
<visible>[String.Contains(ListItem.Plot,"item=") + ListItem.HasEpg] + [Window.IsVisible(tvguide)|Window.IsVisible(tvsearch)|Window.IsVisible(tvchannels)]</visible>
</item>
<item library="resources/lib/context_record.py" args="del">
<label>30117</label>
<visible>[String.Contains(ListItem.PVRInstanceName, PseudoTV Live) + Window.IsVisible(tvrecordings)]</visible>
<visible>[String.StartsWith(ListItem.PVRInstanceName, PseudoTV Live) + Window.IsVisible(tvrecordings)]</visible>
</item>
<item library="resources/lib/context_play.py" args="playlist">
<label>30076</label>
Expand All @@ -56,8 +59,13 @@
<item library="resources/lib/context_create.py">
<label>30114</label>
<visible>[!ListItem.IsPlayable + ListItem.IsFolder] + [!String.IsEmpty(ListItem.Label)]</visible>
</item>
<item library="resources/lib/context_create.py" args="manage">
<label>30107</label>
<visible>[String.Contains(ListItem.Plot,"item=")] + [Window.IsVisible(tvchannels)]</visible>
</item>
</menu>
</menu>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="en_GB">PseudoTV Live acts like a set-top box for Kodi!</summary>
Expand Down
10 changes: 10 additions & 0 deletions plugin.video.pseudotv.live/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
v.0.5.4
-Improved PVR Provider meta.
- If you haven't installed Kodi master nightlies, you ought; Many PVR Improvements.
-Moved all context menu under "PseudoTV Live".
-Added Channel Manager to channel list context menu.
-Fixed Autotune prompt not showing.
-Fixed Disable Trakt, Playcount Rollback not triggering.
-Added "Restart" replay prompt.
- When media is in-progress, a button will appear to restart the program from the beginning.
Media will be launched as a singular VOD event.
- Global and Adv. Channel rule to disable/set restart parameters.
-Added "Resume Later" recordings option.
- When using "Add to Recordings" on currently playing content an option to "Incl. Resume" will be offered.
Resume later will start the future playback at the resume position for easy viewing later...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,14 @@ msgctxt "#30152"
msgid "Resume Later"
msgstr ""

msgctxt "#30153"
msgid "Set Replay Percentage"
msgstr ""

msgctxt "#30154"
msgid "Channel Manager (PseudoTV)"
msgstr ""

# Skin - strings 31000 thru 31999 reserved for skins


Expand Down Expand Up @@ -1374,6 +1382,11 @@ msgctxt "#32183"
msgid "Select server to remove."
msgstr ""

msgctxt "#32184"
msgid "Replay Percentage (%s)"
msgstr ""


# Help - strings 33000 thru 33999 reserved for common strings used in add-ons

msgctxt "#33001"
Expand Down Expand Up @@ -1644,6 +1657,10 @@ msgctxt "#33150"
msgid "Parse Library & Build Channels while playing."
msgstr ""

msgctxt "#33153"
msgid "[B]Restart[/B] prompt when media progress above % [0% Disabled, 5% Default]."
msgstr ""

msgctxt "#33159"
msgid "Force a complete rebuild of your Autotune library."
msgstr ""
Expand Down
9 changes: 0 additions & 9 deletions plugin.video.pseudotv.live/resources/lib/channelbug.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@
from ast import literal_eval
from globals import *

# Actions
ACTION_MOVE_LEFT = 1
ACTION_MOVE_RIGHT = 2
ACTION_MOVE_UP = 3
ACTION_MOVE_DOWN = 4
ACTION_SELECT_ITEM = 7
ACTION_INVALID = 999
ACTION_PREVIOUS_MENU = [92,10,110,521,ACTION_SELECT_ITEM]

class ChannelBug(xbmcgui.WindowXML):
lastActionTime = time.time()

Expand Down
15 changes: 13 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
LANGUAGE = REAL_SETTINGS.getLocalizedString

#constants
OVERLAY_DELAY = 15 #secs
OVERLAY_DELAY = 5 #secs
EPOCH_TIMER = 15 #secs
DTFORMAT = '%Y%m%d%H%M%S'
DTZFORMAT = '%Y%m%d%H%M%S +%z'
DTJSONFORMAT = '%Y-%m-%d %H:%M:%S'
Expand Down Expand Up @@ -76,7 +77,8 @@
GROUP_TYPES = ['Addon', 'Directory', 'TV', 'Movies', 'Music', 'Other', 'PVR', 'Plugin', 'Radio', 'Smartplaylist', 'UPNP', 'IPTV'] + AUTOTUNE_TYPES

WEB_TYPES = ["http",
"ftp"]
"ftp",
"pvr"]

VFS_TYPES = ["plugin://",
"pvr://",
Expand Down Expand Up @@ -194,6 +196,15 @@

# https://github.com/xbmc/xbmc/blob/master/xbmc/addons/kodi-dev-kit/include/kodi/c-api/gui/input/action_ids.h

# Actions
ACTION_MOVE_LEFT = 1
ACTION_MOVE_RIGHT = 2
ACTION_MOVE_UP = 3
ACTION_MOVE_DOWN = 4
ACTION_INVALID = 999
ACTION_SELECT_ITEM = [7,135]
ACTION_PREVIOUS_MENU = [92,10,110,521,ACTION_SELECT_ITEM]

#rules
##builder
RULES_ACTION_CHANNEL_CITEM = 1
Expand Down
35 changes: 27 additions & 8 deletions plugin.video.pseudotv.live/resources/lib/context_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,26 @@
from manager import Manager

class Create:
def __init__(self, sysARG: dict, listitem: xbmcgui.ListItem=xbmcgui.ListItem()):
log('Create: __init__, sysARG = %s'%(sysARG))
if not listitem.getPath(): return DIALOG.notificationDialog(LANGUAGE(32030))
if DIALOG.yesnoDialog('Would you like to add:\n[B]%s[/B]\nto the first available %s channel?'%(listitem.getLabel(),ADDON_NAME)):
def __init__(self, sysARG: dict={}, listitem: xbmcgui.ListItem=xbmcgui.ListItem(), fitem: dict={}):
log('Create: __init__, sysARG = %s, fitem = %s\npath = %s'%(sysARG,fitem,listitem.getPath()))
self.sysARG = sysARG
self.fitem = fitem
self.listitem = listitem


def add(self):
if not self.listitem.getPath(): return DIALOG.notificationDialog(LANGUAGE(32030))
if DIALOG.yesnoDialog('Would you like to add:\n[B]%s[/B]\nto the first available %s channel?'%(self.listitem.getLabel(),ADDON_NAME)):
if not PROPERTIES.isRunning('MANAGER_RUNNING'):
with PROPERTIES.setRunning('MANAGER_RUNNING'), BUILTIN.busy_dialog(), PROPERTIES.suspendActivity():
manager = Manager("%s.manager.xml"%(ADDON_ID), ADDON_PATH, "default", start=False)
channelData = manager.newChannel
channelData['type'] = 'Custom'
channelData['favorite'] = True
channelData['number'] = manager.getFirstAvailChannel()
channelData['radio'] = True if listitem.getPath().startswith('musicdb://') else False
channelData['name'], channelData = manager.validateLabel(cleanLabel(listitem.getLabel()),channelData)
path, channelData = manager.validatePath(unquoteString(listitem.getPath()),channelData,spinner=False)
channelData['radio'] = True if self.listitem.getPath().startswith('musicdb://') else False
channelData['name'], channelData = manager.validateLabel(cleanLabel(self.listitem.getLabel()),channelData)
path, channelData = manager.validatePath(unquoteString(self.listitem.getPath()),channelData,spinner=False)
if path is None: return
channelData['path'] = [path.strip('/')]
channelData['id'] = getChannelID(channelData['name'], channelData['path'], channelData['number'])
Expand All @@ -46,5 +52,18 @@ def __init__(self, sysARG: dict, listitem: xbmcgui.ListItem=xbmcgui.ListItem()):
manager = Manager("%s.manager.xml"%(ADDON_ID), ADDON_PATH, "default", channel=channelData['number'])
del manager


def open(self):
if not PROPERTIES.isRunning('MANAGER_RUNNING'):
with PROPERTIES.setRunning('MANAGER_RUNNING'), BUILTIN.busy_dialog(), PROPERTIES.suspendActivity():
chnum = self.fitem.get('citem',{}).get('number',1)
if chnum > CHANNEL_LIMIT: chnum = 1
manager = Manager("%s.manager.xml"%(ADDON_ID), ADDON_PATH, "default", channel=chnum)
del manager


if __name__ == '__main__':
Create(sys.argv,listitem=sys.listitem)
param = sys.argv[1]
log('Create: __main__, param = %s'%(param))
if param == 'manage': Create(sys.argv,listitem=sys.listitem,fitem=decodePlot(BUILTIN.getInfoLabel('Plot'))).open()
else: Create(sys.argv,listitem=sys.listitem,fitem=decodePlot(BUILTIN.getInfoLabel('Plot'))).add()
15 changes: 8 additions & 7 deletions plugin.video.pseudotv.live/resources/lib/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def run(sysARG):
chid = (params.get("chid",'') or None)
vid = decodeString(params.get("vid",'') or None)
radio = (params.get("radio",'') or 'False').lower() == "true"
log("Default: run, params = %s"%(params))
isPlay = bool(SETTINGS.getSettingInt('Playback_Method'))
log("Default: run, params = %s, isPlaylist = %s"%(params,isPlay))

if mode == 'guide':
hasAddon(PVR_CLIENT_ID,install=True,enable=True)
Expand All @@ -39,12 +40,12 @@ def run(sysARG):
if hasAddon(PVR_CLIENT_ID,install=True,enable=True): SETTINGS.openSettings()
elif chid and not vid:
return DIALOG.notificationDialog(LANGUAGE(32166)%(PVR_CLIENT_NAME,SETTINGS.IPTV_SIMPLE_SETTINGS().get('m3uRefreshIntervalMins')))
elif mode in ['vod','dvr']: threadit(Plugin(sysARG).playVOD)(title,vid)
elif mode in ['vod','dvr']: threadit(Plugin(sysARG).playVOD)(title,vid)
elif mode == 'live':
if bool(SETTINGS.getSettingInt('Playback_Method')): threadit(Plugin(sysARG).playPlaylist)(name,chid)
else: threadit(Plugin(sysARG).playLive)(name,chid,vid)
elif mode == 'broadcast': threadit(Plugin(sysARG).playBroadcast)(name,chid,vid)
elif mode == 'radio': threadit(Plugin(sysARG).playRadio)(name,chid,vid)
elif mode == 'tv': threadit(Plugin(sysARG).playTV)(name,chid)
if isPlay: threadit(Plugin(sysARG).playPlaylist)(name,chid)
else: threadit(Plugin(sysARG).playLive)(name,chid,vid)
elif mode == 'broadcast': threadit(Plugin(sysARG).playBroadcast)(name,chid,vid)
elif mode == 'radio': threadit(Plugin(sysARG).playRadio)(name,chid,vid)
elif mode == 'tv': threadit(Plugin(sysARG).playTV)(name,chid)

if __name__ == '__main__': run(sys.argv)
8 changes: 3 additions & 5 deletions plugin.video.pseudotv.live/resources/lib/fillers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def getAdvertPath(self, id: str='plugin.video.ispot.tv') -> list:
try: folder = os.path.join(xbmcaddon.Addon(id).getSetting('Download_Folder'),'resources','').replace('/resources/resources','/resources').replace('\\','/')
except: folder = 'special://profile/addon_data/%s/resources/'%(id)
self.log('getAdvertPath, folder = %s'%(folder))
return [folder]
return []
return folder
return ''


def fillSources(self):
Expand Down Expand Up @@ -95,9 +95,7 @@ def __sortItems(data, stype='folder'):
elif path.startswith('plugin://'): return __sortItems(_parseVFS(path),'plugin')
elif not path.startswith(tuple(VFS_TYPES)): return __sortItems(_parseLocal(path))
else: return {}
except Exception as e:
self.log("buildSource, failed! %s\n path = %s"%(e,path), xbmc.LOGERROR)
DIALOG.notificationDialog("Error occurred adding fillers, please submit your Kodi debug log for review, Thanks...") #todo remove
except Exception as e: self.log("buildSource, failed! %s\n path = %s"%(e,path), xbmc.LOGERROR)


def convertMPAA(self, ompaa):
Expand Down
Loading

0 comments on commit e22cb03

Please sign in to comment.