Skip to content

Commit

Permalink
v.0.5.7h
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Jan 5, 2025
1 parent 5bb015d commit 6a6adca
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 24 deletions.
2 changes: 2 additions & 0 deletions language_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down
22 changes: 10 additions & 12 deletions plugin.video.pseudotv.live/resources/lib/autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down
7 changes: 7 additions & 0 deletions plugin.video.pseudotv.live/resources/lib/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
10 changes: 8 additions & 2 deletions plugin.video.pseudotv.live/resources/lib/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,29 @@ 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()


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()


Expand Down
11 changes: 4 additions & 7 deletions plugin.video.pseudotv.live/resources/lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions plugin.video.pseudotv.live/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@
</options>
</constraints>
<dependencies>
<dependency type="enable">
<dependency type="visible">
<condition operator="is" setting="Overlay_Enable">true</condition>
</dependency>
</dependencies>
Expand All @@ -596,7 +596,8 @@
<dependency type="visible">
<and>
<condition operator="is" setting="Overlay_Enable">true</condition>
<condition operator="is" setting="OnNext_Enable">1</condition>
<condition operator="gt" setting="OnNext_Enable">0</condition>
<condition operator="lt" setting="OnNext_Enable">3</condition>
</and>
</dependency>
<dependency type="enable">
Expand Down
Binary file not shown.

0 comments on commit 6a6adca

Please sign in to comment.