Skip to content

Commit

Permalink
v.0.5.4f
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Sep 19, 2024
1 parent 6e9a064 commit b28421e
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 35 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.4e" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.4f" 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 @@
6157b370d1a203fbc52477eeb97f0c8a
65d5dcdf92c4c5f52a67b1c63d70ce5f
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.4e" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.5.4f" 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
1 change: 1 addition & 0 deletions plugin.video.pseudotv.live/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
v.0.5.5
-Fixed "Play from here" playback.
-Added Local to URL image converter; hosted via Kodi webserver and PseudoTV Server.
-Added "Smart" TV-guide loading as the default when launching PseudoTV Live via Kodi UI.
- If multiple-instances guide will open to "PseudoTV Live [All channels]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ msgid "Library"
msgstr ""

msgctxt "#32042"
msgid "Welcome to %s!\nNo Channels found, Would you like to\nAutoTune sample channels?\nAutoTune anytime via Utility Menu."
msgid "Welcome to %s!\nNo Channels found, Would you like to\nAutoTune sample channels?"
msgstr ""

msgctxt "#32043"
Expand Down
10 changes: 2 additions & 8 deletions plugin.video.pseudotv.live/resources/lib/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ def log(self, msg, level=xbmc.LOGDEBUG):
return log('%s: %s'%(self.__class__.__name__,msg),level)


def migrate(self, citem):#update channel logo and verify labels, migrate changes to citem.
self.log('migrate, id: %s'%(citem['id']))
citem['name'] = validString(citem['name']) #todo correct existing file names, remove v.0.5.3.
citem['logo'] = self.resources.getLogo(citem['name'],citem['type'],logo=Seasonal().getHoliday().get('logo') if citem['name'] == LANGUAGE(32002) else None)
return citem


def verify(self, channels: list=[]):
if not channels: channels = self.channels.getChannels()
PROPERTIES.setEXTProperty('%s.has.Channels'%(ADDON_ID),str(len(channels)>0).lower())
Expand All @@ -105,7 +98,8 @@ def verify(self, channels: list=[]):
self.log('verify, skipping - missing necessary channel meta\n%s'%(citem))
continue
else:
citem = self.migrate(citem)
citem['name'] = validString(citem['name']) #todo temp. correct existing file names; drop by v.0.6
citem['logo'] = self.resources.getLogo(citem['name'],citem['type'],logo=Seasonal().getHoliday().get('logo') if citem['name'] == LANGUAGE(32002) else None)
self.log('verify, channel %s: %s - %s'%(citem['number'],citem['name'],citem['id']))
yield self.runActions(RULES_ACTION_CHANNEL_CITEM, citem, citem, inherited=self)

Expand Down
3 changes: 1 addition & 2 deletions plugin.video.pseudotv.live/resources/lib/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#
# -*- coding: utf-8 -*-

import sqlite3

from globals import *
from functools import wraps
try: from simplecache import SimpleCache
Expand Down Expand Up @@ -88,6 +86,7 @@ def get(self, name, checksum=ADDON_VERSION, json_data=False):


def clear(self, name, wait=15):
import sqlite3
self.log('clear, name = %s'%self.getname(name))
sc = xbmcvfs.translatePath(xbmcaddon.Addon(id='script.module.simplecache').getAddonInfo('profile'))
dbpath = os.path.join(sc, 'simplecache.db')
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/context_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def run(sysARG, fitem: dict={}, nitem: dict={}):
params["chid"] = (params.get("chid") or fitem.get('citem',{}).get('id'))
params['title'] = (params.get('title') or BUILTIN.getInfoLabel('label'))
params['name'] = (unquoteString(params.get("name",'')) or BUILTIN.getInfoLabel('ChannelName'))
params['isPlaylist'] = bool(SETTINGS.getSettingInt('Playback_Method'))
params['isPlaylist'] = (mode == 'playlist')
log("Context_Play: run, params = %s"%(params))

if mode == 'play': threadit(Plugin(sysARG, sysInfo=params).playTV)(params["name"],params["chid"])
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/cqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __start(self):

def __run(self, func, args=(), kwargs=None):
self.log("__run, func = %s"%(func.__name__))
try: return func(*args, **kwargs)
try: return executeit(func)(*args, **kwargs)
except Exception as e: self.log("__run, func = %s failed! %s"%(func.__name__,e), xbmc.LOGERROR)


Expand Down
3 changes: 2 additions & 1 deletion plugin.video.pseudotv.live/resources/lib/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def run(sysARG, fitem: dict={}, nitem: dict={}):
params['isPlaylist'] = bool(SETTINGS.getSettingInt('Playback_Method'))
log("Default: run, params = %s"%(params))

if mode == 'guide' and hasAddon(PVR_CLIENT_ID,install=True,enable=True): SETTINGS.openGuide()
if PROPERTIES.isRunning('togglePVR'): DIALOG.notificationDialog(LANGUAGE(32000))
elif mode == 'guide' and hasAddon(PVR_CLIENT_ID,install=True,enable=True): SETTINGS.openGuide()
elif mode == 'settings' and hasAddon(PVR_CLIENT_ID,install=True,enable=True): SETTINGS.openSettings()
elif not params["chid"]: DIALOG.notificationDialog(LANGUAGE(32000))
elif mode in ['vod','dvr']: threadit(Plugin(sysARG, sysInfo=params).playVOD)(params["title"],params["vid"])
Expand Down
7 changes: 4 additions & 3 deletions plugin.video.pseudotv.live/resources/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ def setSettingDict(self, key, values):
return self.setSetting(key,encodeString(dumpJSON(values)))


def setCacheSetting(self, key, value, checksum=ADDON_VERSION, life=datetime.timedelta(days=84), json_data=False):
def setCacheSetting(self, key, value, checksum=ADDON_VERSION, life=datetime.timedelta(days=84), json_data=False, force=True):
if force: self.cache.clear(key)
return self.cache.set(key, value, checksum, life, json_data)


Expand All @@ -324,11 +325,11 @@ def setEXTSetting(self, id, key, value):


def hasAutotuned(self):
return self.getCacheSetting('hasAutotuned',checksum=1)
return self.getCacheSetting('hasAutotuned', checksum=1)


def setAutotuned(self, state=True):
return self.setCacheSetting('hasAutotuned',state,checksum=1)
return self.setCacheSetting('hasAutotuned', state, checksum=1)


def getFriendlyName(self):
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 @@ -100,7 +100,7 @@ class RequestHandler(BaseHTTPRequestHandler):
def __init__(self, request, client_address, server, monitor):
self.monitor = monitor
try: BaseHTTPRequestHandler.__init__(self, request, client_address, server)
except (IOError, OSError) as e: self.log('__init__ failed! %s'%(e),xbmc.LOGERROR)
except (IOError, OSError) as e: pass


def log(self, msg, level=xbmc.LOGDEBUG):
Expand Down
16 changes: 9 additions & 7 deletions plugin.video.pseudotv.live/resources/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,19 @@ def _onChange(self):
self.toggleBackground()
oldInfo = self.sysInfo

if oldInfo.get('isPlaylist') and oldInfo.get('nitem'):
self.sysInfo = self.getPlayerSysInfo()
if oldInfo.get('start',random.random()) != self.sysInfo.get('start',random.random()):
if oldInfo.get('isPlaylist'):
sysInfo = self.getPlayerSysInfo()
if not sysInfo.get('fitem') and self.isPlaying(): return self.myService.tasks._que(self._onChange,1)
elif sysInfo.get('fitem',{}).get('label') == oldInfo.get('nitem',{}).get('label',str(random.random())):
self.sysInfo = sysInfo
self.log('_onChange, updated sysInfo')
self.runActions(RULES_ACTION_PLAYER_CHANGE, self.sysInfo.get('citem',{}), inherited=self)
self.setPlayruntime(self.saveDuration,self.sysInfo.get('fitem',{}),sysInfo.get('runtime'))
self.setPlaycount(self.rollbackPlaycount,oldInfo.get('fitem',{}))
else:
self.log('_onChange, callback = %s'%(oldInfo['callback']))
threadit(BUILTIN.executebuiltin)('PlayMedia(%s)'%(oldInfo['callback']))
return
self.log('_onChange, callback = %s'%(oldInfo['callback']))
threadit(BUILTIN.executebuiltin)('PlayMedia(%s)'%(oldInfo['callback']))


def _onStop(self):
self.log('_onStop')
Expand Down
11 changes: 5 additions & 6 deletions plugin.video.pseudotv.live/resources/lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,11 @@ def chkVersion(self):


def chkFiles(self):
self.log('chkFiles')
# check for missing files and run appropriate action to rebuild them only after init. startup.
if PROPERTIES.hasFirstrun():
if not FileAccess.exists(LIBRARYFLEPATH): self._que(self.chkLibrary)
if not (FileAccess.exists(CHANNELFLEPATH) & FileAccess.exists(M3UFLEPATH) & FileAccess.exists(XMLTVFLEPATH) & FileAccess.exists(GENREFLEPATH)): self._que(self.chkChannels)
elif not FileAccess.exists(LOGO_LOC): FileAccess.makedirs(LOGO_LOC) #check logo folder
if not FileAccess.exists(LIBRARYFLEPATH): self._que(self.chkLibrary)
if not (FileAccess.exists(CHANNELFLEPATH) & FileAccess.exists(M3UFLEPATH) & FileAccess.exists(XMLTVFLEPATH) & FileAccess.exists(GENREFLEPATH)): self._que(self.chkChannels)
if not FileAccess.exists(LOGO_LOC): FileAccess.makedirs(LOGO_LOC) #check logo folder
if not FileAccess.exists(FILLER_LOC): FileAccess.makedirs(FILLER_LOC) #check fillers folder


def chkPVRRefresh(self):
Expand Down Expand Up @@ -209,7 +208,7 @@ def chkChannels(self):
else:
self.service.currentChannels = list(channels)
if updated: PROPERTIES.setEXTProperty('%s.chkPVRRefresh'%(ADDON_ID),'true')
if not PROPERTIES.hasFirstrun(): PROPERTIES.setFirstrun(state=True)
if not PROPERTIES.hasFirstrun(): PROPERTIES.setFirstrun(state=True)
except Exception as e:
self.log('chkChannels failed! %s'%(e), xbmc.LOGERROR)

Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
<group id="1">
<setting id="Resource_Logos" type="list[addon]" label="30027" help="33160">
<level>2</level>
<default>resource.images.studios.coloured|resource.images.pseudotv.logos</default>
<default>resource.images.pseudotv.logos</default>
<constraints>
<addontype>kodi.resource.images</addontype>
</constraints>
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit b28421e

Please sign in to comment.