Skip to content

Commit

Permalink
v.0.4.5a
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Jan 23, 2024
1 parent 6a38674 commit 6a33c54
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 17 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.4.5" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.4.5a" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="7.5.0"/>
Expand Down
2 changes: 1 addition & 1 deletion addons.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2b9ecee131a2435c7c5bba3ec637729d
aaeaccee130840fdeb3bc2bc232b5ac4
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.4.5" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.4.5a" name="PseudoTV Live" provider-name="Lunatixz">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="pvr.iptvsimple" version="7.5.0"/>
Expand Down
5 changes: 3 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,11 @@ def is3D(self, item):

def addChannelStation(self, citem):
self.log('addChannelStation, id: %s'%(citem['id']))
citem['url'] = PVR_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),id=quoteString(citem['id']),radio=str(citem['radio']))
citem['url'] = PVR_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),channel=quoteString(citem['id']),radio=str(citem['radio']))
citem['logo'] = cleanImage(citem['logo'])
citem['group'] = cleanGroups(citem, self.enableGrouping)
# if citem['catchup']: citem['catchup-source'] = SRC_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),channel=quoteString(citem['id']),source='&id={catchup-id}&starttime={Y}-{m}-{d}-{H}-{M}-{S}')
if citem['catchup']:
citem['catchup-source'] = SRC_URL.format(addon=ADDON_ID,name=quoteString(citem['name']),channel=quoteString(citem['id']),source='&id={catchup-id}&starttime={Y}-{m}-{d}-{H}-{M}-{S}')
self.m3u.addStation(citem)
return self.xmltv.addChannel(citem)

Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
">": "&gt;",
"<": "&lt;"}

PVR_URL = 'plugin://{addon}/?mode=play&name={name}&id={id}&radio={radio}.pvr'
PVR_URL = 'plugin://{addon}/?mode=play&name={name}&channel={channel}&radio={radio}.pvr'
VOD_URL = 'plugin://{addon}/?mode=vod&name={name}&id={id}&channel={channel}.pvr'
SRC_URL = 'plugin://{addon}/?mode=broadcast&name={name}&channel={channel}{source}.pvr'

Expand Down
7 changes: 3 additions & 4 deletions plugin.video.pseudotv.live/resources/lib/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ def run(sysARG):
elif mode == 'vod':
threadit(Plugin(sysARG).playVOD)(name,id)
elif mode == 'broadcast':
print('broadcast',id,starttime)
# threadit(Plugin(sysARG).playVOD)(name,id)
threadit(Plugin(sysARG).playVOD)(name,id)
elif mode == 'play':
if radio: threadit(Plugin(sysARG).playRadio)(name,id)
else: threadit(Plugin(sysARG).playChannel)(name,id,bool(SETTINGS.getSettingInt('Playback_Method')))
if radio: threadit(Plugin(sysARG).playRadio)(name,channel)
else: threadit(Plugin(sysARG).playChannel)(name,channel,bool(SETTINGS.getSettingInt('Playback_Method')))

if __name__ == '__main__': run(sys.argv)

Expand Down
5 changes: 2 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/m3u.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ def _save(self, file=M3UFLEPATH):

opts = list(self.getMitem().keys())
mins = [opts.pop(opts.index(key)) for key in list(M3U_MIN.keys()) if key in opts] #min required m3u entries.
line = '#EXTINF:-1 tvg-chno="%s" tvg-id="%s" tvg-name="%s" tvg-logo="%s" group-title="%s" radio="%s" catchup="%s" %s,%s\n'
# line = '#EXTINF:-1 tvg-chno="%s" tvg-id="%s" tvg-name="%s" tvg-logo="%s" group-title="%s" radio="%s" catchup="%s" catchup-source="%s" %s,%s\n'
line = '#EXTINF:-1 tvg-chno="%s" tvg-id="%s" tvg-name="%s" tvg-logo="%s" group-title="%s" radio="%s" catchup="%s" catchup-source="%s" %s,%s\n'
self.M3UDATA['stations'] = self.sortStations(self.M3UDATA.get('stations',[]))
self.M3UDATA['recordings'] = self.sortStations(self.M3UDATA.get('recordings',[]))
self.log('_save, saving %s stations and %s recordings to %s'%(len(self.M3UDATA['stations']),len(self.M3UDATA['recordings']),file))
Expand All @@ -230,7 +229,7 @@ def _save(self, file=M3UFLEPATH):
';'.join(station['group']),
station['radio'],
station['catchup'],
# station['catchup-source'],
station['catchup-source'],
optional,
station['label']))

Expand Down
5 changes: 1 addition & 4 deletions plugin.video.pseudotv.live/resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ def _checkLastPlayed(self, nowitem):
diff = True
olditem = loadJSON(PROPERTIES.getEXTProperty('%s.lastNOWITEM'%(ADDON_ID)))
if ((nowitem.get('channeluid',random.random()) == olditem.get('channeluid',random.random())) &
(nowitem.get('broadcastid',random.random()) == olditem.get('broadcastid',random.random())) &
(nowitem.get('progress',random.random()) == olditem.get('progress',random.random()))): diff = False
(nowitem.get('broadcastid',random.random()) == olditem.get('broadcastid',random.random()))): diff = False
self.log('_checkLastPlayed, diff = %s'%(diff))
return diff

Expand Down Expand Up @@ -265,7 +264,6 @@ def playRadio(self, name, id, isPlaylist=True):
self.channelPlaylist.add(lz.getPath(),lz,idx)

self.log('playRadio, Playlist size = %s'%(self.channelPlaylist.size()))
PROPERTIES.clearEXTProperty('%s.lastNOWITEM'%(ADDON_ID))
PROPERTIES.clearEXTProperty('%s.pendingPVRITEM.%s'%(ADDON_ID,pvritem.get('channelid','-1')))
if not isPlaylistRandom(): self.channelPlaylist.shuffle()
if PLAYER.isPlayingVideo(): PLAYER.stop()
Expand Down Expand Up @@ -321,7 +319,6 @@ def contextPlay(self, writer={}, isPlaylist=False):
for idx,lz in enumerate(listitems):
self.channelPlaylist.add(lz.getPath(),lz,idx)

PROPERTIES.clearEXTProperty('%s.lastNOWITEM'%(ADDON_ID))
PROPERTIES.clearEXTProperty('%s.pendingPVRITEM.%s'%(ADDON_ID,pvritem.get('channelid','-1')))
self.log('contextPlay, Playlist size = %s'%(self.channelPlaylist.size()))
if isPlaylistRandom(): self.channelPlaylist.unshuffle()
Expand Down
1 change: 1 addition & 0 deletions plugin.video.pseudotv.live/resources/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def _onStop(self):
self.log('_onStop')
self.toggleBackground(False)
self.runActions(RULES_ACTION_PLAYER_STOP, self.pvritem.get('citem',{}), inherited=self)
PROPERTIES.clearEXTProperty('%s.lastNOWITEM'%(ADDON_ID))
if self.pvritem.get('isPlaylist',False): xbmc.PlayList(xbmc.PLAYLIST_VIDEO).clear()


Expand Down
Binary file not shown.

0 comments on commit 6a33c54

Please sign in to comment.