From a1311b309b39e9fcb562b1586fbfc20945ca33db Mon Sep 17 00:00:00 2001 From: peno64 <32430988+peno64@users.noreply.github.com> Date: Sat, 2 Dec 2023 17:40:03 +0100 Subject: [PATCH] Fix for Configure IPTV automatically (#109) Configure IPTV automatically creates a settings.xml file for IPTV Simple but IPTV Simple uses another name. This fix copies the generated settings.xml file to the other .xml files --- resources/lib/modules/iptvsimple.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/lib/modules/iptvsimple.py b/resources/lib/modules/iptvsimple.py index 23cf481..26adafc 100644 --- a/resources/lib/modules/iptvsimple.py +++ b/resources/lib/modules/iptvsimple.py @@ -12,6 +12,8 @@ from resources.lib import kodiutils +import xbmcvfs, glob, shutil + _LOGGER = logging.getLogger(__name__) IPTV_SIMPLE_ID = 'pvr.iptvsimple' @@ -65,6 +67,14 @@ def setup(cls): # Activate IPTV Simple cls._activate() + # If iptv simple uses another name than settings.cml for the configuration file then copy the generated settings.xml to that other name + path = xbmcvfs.translatePath(addon.getAddonInfo('profile')) + settingsxml = path + 'settings.xml' + if os.path.isfile(settingsxml): + for f in glob.glob(path + "*.xml"): + if os.path.basename(f) != 'settings.xml': + shutil.copyfile(settingsxml, f) + return True @classmethod