diff --git a/language_report.txt b/language_report.txt index e18c321f..fb45a354 100644 --- a/language_report.txt +++ b/language_report.txt @@ -179,12 +179,14 @@ Language IDS not found in py files, possibly only in xml: { "32053": "Settings", "32054": "Initializing...", "32057": "%s is busy, try again later...", + "32058": "Cancelling Autotune\\nExisting Channels Detected...", "32074": "Adding Channel", "32075": "Saving...", "32082": "Clear this Channels Configurations", "32113": "Recovering Channel", "32114": "Online", "32115": "Running as a client.", + "32128": "Rebuilding Autotuned Channels", "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.", "32141": "Shutting Down...", diff --git a/plugin.video.pseudotv.live/resources/lib/autotune.py b/plugin.video.pseudotv.live/resources/lib/autotune.py index f1bf9717..c9f0a3de 100644 --- a/plugin.video.pseudotv.live/resources/lib/autotune.py +++ b/plugin.video.pseudotv.live/resources/lib/autotune.py @@ -54,42 +54,40 @@ def _runTune(self, samples: bool=False, rebuild: bool=False, dia=None): autoChannels = self.getAutotuned() self.log('_runTune, custom channels = %s, autotune channels = %s'%(len(customChannels),len(autoChannels))) - if len(autoChannels) > 0: #rebuild existing autotune. + if len(autoChannels) > 0: #rebuild existing autotune rebuild = True PROPERTIES.setEXTPropertyBool('%s.has.Predefined'%(ADDON_ID),True) - if SETTINGS.getSettingBool('Debug_Enable'): DIALOG.notificationDialog(LANGUAGE(32128)) - elif len(customChannels) == 0 and not PROPERTIES.hasAutotuned(): autoEnabled = [] [autoEnabled.extend(self.library.getEnabled(type)) for type in AUTOTUNE_TYPES] if len(autoEnabled) > 0: self.log('_runTune, library enabled items = %s; recovering enabled items'%(len(autoEnabled))) rebuild = True #recover empty channels.json with enabled library.json items. - else: - samples = True #create sample channels "autotune". + elif isCenterlized(): return True + else: samples = True #create sample channels "autotune". if samples: - opt = '' - msg = (LANGUAGE(32042)%ADDON_NAME) hasBackup = PROPERTIES.hasBackup() hasServers = PROPERTIES.hasServers() hasChannels = PROPERTIES.hasChannels() + if hasBackup: opt = LANGUAGE(32112) msg = '%s\n%s'%((LANGUAGE(32042)%ADDON_NAME),LANGUAGE(32111)) elif hasServers: opt = LANGUAGE(30092) msg = '%s\n%s'%((LANGUAGE(32042)%ADDON_NAME),LANGUAGE(32215)) - + else: + opt = '' + msg = (LANGUAGE(32042)%ADDON_NAME) + retval = DIALOG.yesnoDialog(message=msg,customlabel=opt) if retval == 1: dia = DIALOG.progressBGDialog(header='%s, %s'%(ADDON_NAME,'%s %s'%(LANGUAGE(32021),LANGUAGE(30038)))) elif retval == 2: if hasBackup: return Backup().recoverChannels() elif hasServers: return BUILTIN.executebuiltin('RunScript(special://home/addons/%s/resources/lib/multiroom.py, Select_Server)'%(ADDON_ID)) - elif not hasChannels: return openAddonSettings() - else: - if SETTINGS.getSettingBool('Debug_Enable'): DIALOG.notificationDialog(LANGUAGE(32058)) - return + elif not hasChannels: return openAddonSettings() + else: return True for idx, ATtype in enumerate(AUTOTUNE_TYPES): if dia: dia = DIALOG.progressBGDialog(int((idx+1)*100//len(AUTOTUNE_TYPES)),dia,ATtype,'%s, %s'%(ADDON_NAME,'%s %s'%(LANGUAGE(32021),LANGUAGE(30038)))) diff --git a/plugin.video.pseudotv.live/resources/lib/globals.py b/plugin.video.pseudotv.live/resources/lib/globals.py index fb80fc5e..d38b55c5 100644 --- a/plugin.video.pseudotv.live/resources/lib/globals.py +++ b/plugin.video.pseudotv.live/resources/lib/globals.py @@ -454,3 +454,10 @@ def percentDiff(org, new): def pagination(list, end): for start in range(0, len(list), end): yield seq[start:start+end] + +def isCenterlized(): + default = 'special://profile/addon_data/plugin.video.pseudotv.live/cache' + if REAL_SETTINGS.getSetting('User_Folder') == default: + return False + return True + \ No newline at end of file diff --git a/plugin.video.pseudotv.live/resources/lib/kodi.py b/plugin.video.pseudotv.live/resources/lib/kodi.py index 4a5f1812..3dc6773d 100644 --- a/plugin.video.pseudotv.live/resources/lib/kodi.py +++ b/plugin.video.pseudotv.live/resources/lib/kodi.py @@ -144,7 +144,7 @@ def log(self, msg, level=xbmc.LOGDEBUG): log('%s: %s'%(self.__class__.__name__,msg),level) - @cacheit(expiration=datetime.timedelta(seconds=FIFTEEN)) + @cacheit(expiration=datetime.timedelta(minutes=FIFTEEN)) def getIP(self, default='127.0.0.1'): IP = (xbmc.getIPAddress() or gethostbyname(gethostname()) or default) log('getIP, IP = %s'%(IP)) diff --git a/plugin.video.pseudotv.live/resources/lib/server.py b/plugin.video.pseudotv.live/resources/lib/server.py index d3fa5205..e76077f5 100644 --- a/plugin.video.pseudotv.live/resources/lib/server.py +++ b/plugin.video.pseudotv.live/resources/lib/server.py @@ -57,6 +57,7 @@ def addService(self, zeroconf, type, name): def __init__(self, service=None, multiroom=None): self.service = service self.multiroom = multiroom + self.cache = SETTINGS.cache self._start() @@ -64,16 +65,21 @@ def log(self, msg, level=xbmc.LOGDEBUG): return log('%s: %s'%(self.__class__.__name__,msg),level) + @cacheit(checksum=PROPERTIES.getInstanceID(), expiration=datetime.timedelta(minutes=FIFTEEN)) + def _getStatus(self): + return self.jsonRPC.getSettingValue("services.zeroconf",default=False) + + def _start(self): if not PROPERTIES.isRunning('Discovery'): with PROPERTIES.setRunning('Discovery'): zconf = Zeroconf() + zcons = self._getStatus() self.log("_start, Multicast DNS Service Discovery (%s)"%(ZEROCONF_SERVICE)) - lastState = SETTINGS.getSetting('ZeroConf_Status') SETTINGS.setSetting('ZeroConf_Status',LANGUAGE(32158)) ServiceBrowser(zconf, ZEROCONF_SERVICE, self.MyListener(multiroom=self.multiroom)) self.service.monitor.waitForAbort(DISCOVER_INTERVAL) - SETTINGS.setSetting('ZeroConf_Status',lastState) + SETTINGS.setSetting('ZeroConf_Status',LANGUAGE(32211)%({True:'green',False:'red'}[zcons],{True:'Online',False:'Offline'}[zcons])) zconf.close() diff --git a/plugin.video.pseudotv.live/resources/lib/tasks.py b/plugin.video.pseudotv.live/resources/lib/tasks.py index 90a87a06..6ce3d46e 100644 --- a/plugin.video.pseudotv.live/resources/lib/tasks.py +++ b/plugin.video.pseudotv.live/resources/lib/tasks.py @@ -104,7 +104,7 @@ def chkPVRBackend(self): def _chkQueTimer(self): self.log('_chkQueTimer') - self._chkEpochTimer('chkVersion' , self.chkVersion , 900) + self._chkEpochTimer('chkVersion' , self.chkVersion , 21600) self._chkEpochTimer('chkKodiSettings' , self.chkKodiSettings , 900) self._chkEpochTimer('chkHTTP' , self.chkHTTP , 900) self._chkEpochTimer('chkDiscovery' , self.chkDiscovery , 300) @@ -160,11 +160,9 @@ def chkVersion(self): def chkKodiSettings(self): self.log('chkKodiSettings') - SETTINGS.setSettingInt('Min_Days' ,self.jsonRPC.getSettingValue('epg.pastdaystodisplay',default=1)) - SETTINGS.setSettingInt('Max_Days' ,self.jsonRPC.getSettingValue('epg.futuredaystodisplay',default=3)) + SETTINGS.setSettingInt('Min_Days' ,self.jsonRPC.getSettingValue('epg.pastdaystodisplay' ,default=1)) + SETTINGS.setSettingInt('Max_Days' ,self.jsonRPC.getSettingValue('epg.futuredaystodisplay' ,default=3)) SETTINGS.setSettingInt('OSD_Timer',self.jsonRPC.getSettingValue('pvrmenu.displaychannelinfo',default=5)) - zeroconf = self.jsonRPC.getSettingValue("services.zeroconf",default=False) - SETTINGS.setSetting('ZeroConf_Status',LANGUAGE(32211)%({True:'green',False:'red'}[zeroconf],{True:'Online',False:'Offline'}[zeroconf])) def chkDirs(self): @@ -300,8 +298,7 @@ def chkAutoTune(self): self.log('chkAutoTune') try: autotune = Autotune(service=self.service) - complete = autotune._runTune() - if complete: PROPERTIES.setAutotuned() + if autotune._runTune(): PROPERTIES.setAutotuned() del autotune except Exception as e: self.log('chkAutoTune failed! %s'%(e), xbmc.LOGERROR) diff --git a/plugin.video.pseudotv.live/resources/settings.xml b/plugin.video.pseudotv.live/resources/settings.xml index d5bc545b..05c396d0 100644 --- a/plugin.video.pseudotv.live/resources/settings.xml +++ b/plugin.video.pseudotv.live/resources/settings.xml @@ -582,7 +582,7 @@ - + true @@ -596,7 +596,8 @@ true - 1 + 0 + 3 diff --git a/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.7h.zip b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.7h.zip index 905b6333..dba17234 100644 Binary files a/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.7h.zip and b/zips/plugin.video.pseudotv.live/plugin.video.pseudotv.live-0.5.7h.zip differ