Skip to content

Commit

Permalink
v.0.4.8f
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunatixz committed Apr 4, 2024
1 parent 41d7cb9 commit 21272c5
Show file tree
Hide file tree
Showing 11 changed files with 217 additions and 232 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.8e" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.4.8f" 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 @@
498bc5e1a7e68216b30483ce441b293e
b063aa46b8e01734a1b950ace056d19b
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.8e" name="PseudoTV Live" provider-name="Lunatixz">
<addon id="plugin.video.pseudotv.live" version="0.4.8f" 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
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ msgid "Include 3D Media."
msgstr ""

msgctxt "#30056"
msgid "Insert Fillers"
msgid "Include Fillers"
msgstr ""

msgctxt "#30057"
Expand Down Expand Up @@ -1229,6 +1229,10 @@ msgctxt "#32164"
msgid "Can not locate broadcast!"
msgstr ""

msgctxt "#32165"
msgid "No Changes Applied!
msgstr ""


# Help - strings 33000 thru 33999 reserved for common strings used in add-ons

Expand Down
3 changes: 1 addition & 2 deletions plugin.video.pseudotv.live/resources/lib/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,7 @@ def setFirstrun(state=True):
return PROPERTIES.setPropertyBool('hasFirstrun',state)

def isClient():
client = PROPERTIES.getEXTProperty('%s.isClient'%(ADDON_ID)) == "true"
return (client | bool(SETTINGS.getSettingInt('Client_Mode')))
return PROPERTIES.getEXTProperty('%s.isClient'%(ADDON_ID)) == "true"

def setClient(state=False,silent=True):
PROPERTIES.setEXTProperty('%s.isClient'%(ADDON_ID),str(state).lower())
Expand Down
13 changes: 5 additions & 8 deletions plugin.video.pseudotv.live/resources/lib/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ def closeBusyDialog():

@contextmanager
def busy_dialog():
if not isBusyDialog():
Builtin().executebuiltin('ActivateWindow(busydialognocancel)')
try: yield
finally:
Builtin().executebuiltin('Dialog.Close(busydialognocancel)')
if not isBusyDialog(): Builtin().executebuiltin('ActivateWindow(busydialognocancel)')
try: yield
finally:
Builtin().executebuiltin('Dialog.Close(busydialognocancel)')

@contextmanager
def sudo_dialog(msg):
Expand Down Expand Up @@ -280,8 +279,6 @@ def setPropertySetting(self, key, value):
def setPVRPath(self, userFolder):
self.log('setPVRPath, userFolder = %s'%(userFolder)) #set local pvr folder
self.setSetting('User_Folder' ,userFolder)
self.setSetting('Network_Folder',userFolder)

CLIENT_MODE = SETTINGS.getSettingInt('Client_Mode')
newSettings = {'m3uPathType' :'%s'%('1' if CLIENT_MODE == 1 else '0'),
'm3uPath' :os.path.join(userFolder,M3UFLE),
Expand Down Expand Up @@ -412,7 +409,7 @@ def setPVRInstance(self, id):

def getCurrentSettings(self):
self.log('getCurrentSettings')
settings = ['User_Folder','Network_Folder','UDP_PORT','TCP_PORT','Client_Mode','Remote_URL','Disable_Cache']
settings = ['User_Folder','UDP_PORT','TCP_PORT','Client_Mode','Remote_URL','Disable_Cache']
for setting in settings:
yield (setting,self.getSetting(setting))

Expand Down
24 changes: 15 additions & 9 deletions plugin.video.pseudotv.live/resources/lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,17 @@ def getIdle(self):
return idleState, idleTime


def chkRemaining(self):
if self.myService.player.isPlaying() and self.myService.player.getTimeRemaining() < 2:
self.myService.player.toggleBackground(True)


def chkIdle(self):
self.isIdle, self.idleTime = self.getIdle()
if self.myService.player.isPseudoTV:
if self.sleepTime > 0 and (self.idleTime > (self.sleepTime * 10800)): #3hr increments
if self.triggerSleep(): return False
if self.isIdle: self.toggleOverlay(True)
else: self.toggleOverlay(False)
if self.sleepTime > 0 and (self.idleTime > (self.sleepTime * 10800)): #3hr increments
if self.triggerSleep(): return False
if self.isIdle: self.toggleOverlay(True)
else: self.toggleOverlay(False)
return self.isIdle


Expand Down Expand Up @@ -351,9 +355,11 @@ def _playing(self) -> bool:


def _run(self):
with setRunning('_run'):
self.monitor.chkIdle()

if self.player.isPseudoTV:
with setRunning('_run'):
self.monitor.chkIdle()
self.monitor.chkRemaining()


def _tasks(self):
with setRunning('_tasks'):
Expand All @@ -378,7 +384,7 @@ def start(self):
if self._interrupt(wait=2): break
elif self._suspend(): continue
else:
if not isRunning('_run'): self._run()
if not isRunning('_run'): self._run()
if not isRunning('_tasks'): self._tasks()
self.stop()

Expand Down
31 changes: 13 additions & 18 deletions plugin.video.pseudotv.live/resources/lib/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,23 @@ def chkQueTimer(self):
self._que(self._chkQueTimer)


def _chkQueTimer(self):
def _chkQueTimer(self, client = isClient()):
self.log('chkQueTimer')
if self.chkUpdateTime('chkHTTP',runEvery=900):
self._que(self.chkHTTP)
if self.chkUpdateTime('chkFiles',runEvery=600):
if self.chkUpdateTime('chkFiles',runEvery=600) and not client:
self._que(self.chkFiles)
if self.chkUpdateTime('chkPVRSettings',runEvery=(MAX_GUIDEDAYS*3600)):
self._que(self.chkPVRSettings)
if self.chkUpdateTime('chkRecommended',runEvery=900):
if self.chkUpdateTime('chkRecommended',runEvery=900) and not client:
self._que(self.chkRecommended)
if self.chkUpdateTime('chkLibrary',runEvery=(MAX_GUIDEDAYS*3600)):
self._que(self.chkLibrary)
if self.chkUpdateTime('chkChannels',runEvery=(MAX_GUIDEDAYS*3600)):
if self.chkUpdateTime('chkChannels',runEvery=(MAX_GUIDEDAYS*3600)) and not client:
self._que(self.chkChannels)
if self.chkUpdateTime('chkPVRSettings',runEvery=(MAX_GUIDEDAYS*3600)) and not client:
self._que(self.chkPVRSettings)
if self.chkUpdateTime('chkHTTP',runEvery=900) and not client:
self._que(self.chkHTTP)
if self.chkUpdateTime('chkJSONQUE',runEvery=600):
self._que(self.chkJSONQUE)


def chkWelcome(self):
self.log('chkWelcome')
Expand Down Expand Up @@ -157,7 +157,6 @@ def chkUpdateTime(self, key, runEvery, nextUpdate=None):

def chkPVRSettings(self):
try:
if isClient(): return
with sudo_dialog(msg='%s %s'%(LANGUAGE(32028),LANGUAGE(30069))):
if (self.jsonRPC.getSettingValue('epg.pastdaystodisplay') or 1) != MIN_GUIDEDAYS:
SETTINGS.setSettingInt('Min_Days',min)
Expand All @@ -182,17 +181,14 @@ def chkLibrary(self):

def chkRecommended(self):
try:
if isClient(): return
else:
library = Library(service=self.myService)
library.searchRecommended()
del library
library = Library(service=self.myService)
library.searchRecommended()
del library
except Exception as e: self.log('chkRecommended failed! %s'%(e), xbmc.LOGERROR)


def chkChannels(self):
try:
if isClient(): return
builder = Builder(self.myService)
complete = builder.build()
channels = builder.verify()
Expand All @@ -207,7 +203,7 @@ def chkChannels(self):
def chkFiles(self):
self.log('_chkFiles')
# check for missing files and run appropriate action to rebuild them only after init. startup.
if hasFirstrun() and not isClient():
if hasFirstrun():
if not (FileAccess.exists(LIBRARYFLEPATH)): self._que(self.chkLibrary,2)
if not (FileAccess.exists(CHANNELFLEPATH) & FileAccess.exists(M3UFLEPATH) & FileAccess.exists(XMLTVFLEPATH) & FileAccess.exists(GENREFLEPATH)):
self._que(self.chkChannels,1)
Expand Down Expand Up @@ -274,7 +270,6 @@ def chkSettingsChange(self, settings=[]):
nSettings = dict(SETTINGS.getCurrentSettings())
for setting, value in list(settings.items()):
actions = {'User_Folder' :{'func':self.setUserPath ,'args':(value,nSettings.get(setting))},
'Network_Folder' :{'func':SETTINGS.setPVRPath ,'args':(nSettings.get(setting))},
'Remote_URL' :{'func':SETTINGS.setPVRRemote,'args':(nSettings.get(setting))},
'UDP_PORT' :{'func':setPendingRestart},
'TCP_PORT' :{'func':setPendingRestart},
Expand Down
2 changes: 1 addition & 1 deletion plugin.video.pseudotv.live/resources/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def run(self):
if SETTINGS.chkPluginSettings(PVR_CLIENT_ID,IPTV_SIMPLE_SETTINGS(),override=True):
DIALOG.notificationDialog(LANGUAGE(32152))
else:
DIALOG.notificationDialog(LANGUAGE(32046))
DIALOG.notificationDialog(LANGUAGE(32165))
elif param.startswith('Channel_Manager'):
ctl = (0,1)
self.openChannelManager()
Expand Down
Loading

0 comments on commit 21272c5

Please sign in to comment.