1.0.0+kodimov.9: get a new guide into Kodi right after start or update

Kodi keeps its own copy of the programme guide and fetches it again only
when IPTV Simple reloads its files, on its refresh timer; restarting IPTV
Simple is not enough. After the first refresh following a Kodi start or
add-on update, if the guide changed and nothing is playing, restart IPTV
Simple with a 1-minute timer, wait for the reload, then restart it with
the hourly timer again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
XoséandClaude Opus 5.5 committed 2026-11-10 08:51:51 +01:00
1 parent 5df60a1fb8
commit e16dd66f63
5 files changed
+50 -16

No files matched your search

+4 -2
View File
@@ -33,7 +33,7 @@ if __name__ == '__main__':
max_age = 0 # always refresh once after Kodi starts
try:
pvr_dir = translatePath(xbmcaddon.Addon('pvr.iptvsimple').getAddonInfo('profile'))
restart_iptv = kodimov.use_hourly_iptv_refresh(pvr_dir, 'kodimovplus')
restart_iptv = kodimov.set_iptv_refresh(pvr_dir, 'kodimovplus')
except RuntimeError: # IPTV Simple not installed or disabled
restart_iptv = False
player = xbmc.Player()
@@ -47,9 +47,11 @@ if __name__ == '__main__':
if time.time() >= next_check:
next_check = time.time() + 30 * 60
age_limit, max_age = max_age, 6 * 3600 - 120
# After Kodi starts (or this add-on updates) also get the new guide into Kodi now
reload_guide = '&reload_guide=1' if age_limit == 0 else ''
if addon.getSettingBool('auto_export_epg'): # channels + programme guide
if file_age(os.path.join(profile_dir, 'epg.xml')) > age_limit:
xbmc.executebuiltin('RunPlugin(plugin://plugin.video.kodimovplus/?action=export_epg_now&quiet=1)')
xbmc.executebuiltin('RunPlugin(plugin://plugin.video.kodimovplus/?action=export_epg_now&quiet=1' + reload_guide + ')')
elif addon.getSettingBool('export_channels'):
if file_age(os.path.join(profile_dir, 'channels.m3u8')) > age_limit:
xbmc.executebuiltin('RunPlugin(plugin://plugin.video.kodimovplus/?action=export_channels_now)')