Skip to content

Commit

Permalink
Fix for Configure IPTV automatically (#109)
Browse files Browse the repository at this point in the history
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
peno64 authored Dec 2, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent bba8792 commit a1311b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resources/lib/modules/iptvsimple.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a1311b3

Please sign in to comment.