diff --git a/addons.xml b/addons.xml index d2770877..439ff59d 100644 --- a/addons.xml +++ b/addons.xml @@ -1,6 +1,6 @@ - + diff --git a/addons.xml.md5 b/addons.xml.md5 index 024a4607..b8b39670 100644 --- a/addons.xml.md5 +++ b/addons.xml.md5 @@ -1 +1 @@ -6157b370d1a203fbc52477eeb97f0c8a \ No newline at end of file +65d5dcdf92c4c5f52a67b1c63d70ce5f \ No newline at end of file diff --git a/plugin.video.pseudotv.live/addon.xml b/plugin.video.pseudotv.live/addon.xml index 66d8e9a2..0c475c81 100644 --- a/plugin.video.pseudotv.live/addon.xml +++ b/plugin.video.pseudotv.live/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/plugin.video.pseudotv.live/changelog.txt b/plugin.video.pseudotv.live/changelog.txt index 58dcfb91..27aafd9b 100644 --- a/plugin.video.pseudotv.live/changelog.txt +++ b/plugin.video.pseudotv.live/changelog.txt @@ -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]" diff --git a/plugin.video.pseudotv.live/resources/language/resource.language.en_gb/strings.po b/plugin.video.pseudotv.live/resources/language/resource.language.en_gb/strings.po index a973f9f6..46349458 100644 --- a/plugin.video.pseudotv.live/resources/language/resource.language.en_gb/strings.po +++ b/plugin.video.pseudotv.live/resources/language/resource.language.en_gb/strings.po @@ -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" diff --git a/plugin.video.pseudotv.live/resources/lib/builder.py b/plugin.video.pseudotv.live/resources/lib/builder.py index 3082f6b9..146920ef 100644 --- a/plugin.video.pseudotv.live/resources/lib/builder.py +++ b/plugin.video.pseudotv.live/resources/lib/builder.py @@ -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()) @@ -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) diff --git a/plugin.video.pseudotv.live/resources/lib/cache.py b/plugin.video.pseudotv.live/resources/lib/cache.py index efb98eb0..82d37a5f 100644 --- a/plugin.video.pseudotv.live/resources/lib/cache.py +++ b/plugin.video.pseudotv.live/resources/lib/cache.py @@ -18,8 +18,6 @@ # # -*- coding: utf-8 -*- -import sqlite3 - from globals import * from functools import wraps try: from simplecache import SimpleCache @@ -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') diff --git a/plugin.video.pseudotv.live/resources/lib/context_play.py b/plugin.video.pseudotv.live/resources/lib/context_play.py index e7c5bef8..65102984 100644 --- a/plugin.video.pseudotv.live/resources/lib/context_play.py +++ b/plugin.video.pseudotv.live/resources/lib/context_play.py @@ -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"]) diff --git a/plugin.video.pseudotv.live/resources/lib/cqueue.py b/plugin.video.pseudotv.live/resources/lib/cqueue.py index 57f7a27f..be9600d6 100644 --- a/plugin.video.pseudotv.live/resources/lib/cqueue.py +++ b/plugin.video.pseudotv.live/resources/lib/cqueue.py @@ -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) diff --git a/plugin.video.pseudotv.live/resources/lib/default.py b/plugin.video.pseudotv.live/resources/lib/default.py index 0b4b6d50..bc6cd3b3 100644 --- a/plugin.video.pseudotv.live/resources/lib/default.py +++ b/plugin.video.pseudotv.live/resources/lib/default.py @@ -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"]) diff --git a/plugin.video.pseudotv.live/resources/lib/kodi.py b/plugin.video.pseudotv.live/resources/lib/kodi.py index 5d00426a..51dc2159 100644 --- a/plugin.video.pseudotv.live/resources/lib/kodi.py +++ b/plugin.video.pseudotv.live/resources/lib/kodi.py @@ -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) @@ -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): diff --git a/plugin.video.pseudotv.live/resources/lib/server.py b/plugin.video.pseudotv.live/resources/lib/server.py index eec3f882..8f091172 100644 --- a/plugin.video.pseudotv.live/resources/lib/server.py +++ b/plugin.video.pseudotv.live/resources/lib/server.py @@ -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): diff --git a/plugin.video.pseudotv.live/resources/lib/service.py b/plugin.video.pseudotv.live/resources/lib/service.py index 584c3b8c..1fc23fce 100644 --- a/plugin.video.pseudotv.live/resources/lib/service.py +++ b/plugin.video.pseudotv.live/resources/lib/service.py @@ -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') diff --git a/plugin.video.pseudotv.live/resources/lib/tasks.py b/plugin.video.pseudotv.live/resources/lib/tasks.py index d86c5613..da240604 100644 --- a/plugin.video.pseudotv.live/resources/lib/tasks.py +++ b/plugin.video.pseudotv.live/resources/lib/tasks.py @@ -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): @@ -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) diff --git a/plugin.video.pseudotv.live/resources/settings.xml b/plugin.video.pseudotv.live/resources/settings.xml index da198e3e..f9931a0f 100644 --- a/plugin.video.pseudotv.live/resources/settings.xml +++ b/plugin.video.pseudotv.live/resources/settings.xml @@ -354,7 +354,7 @@ 2 - resource.images.studios.coloured|resource.images.pseudotv.logos + resource.images.pseudotv.logos kodi.resource.images diff --git a/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.4e.zip b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.4e.zip index 213a54e2..d2e15e80 100644 Binary files a/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.4e.zip and b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.4e.zip differ diff --git a/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.4f.zip b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.4f.zip new file mode 100644 index 00000000..6b2ec7fc Binary files /dev/null and b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.4f.zip differ