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
  • Loading branch information
peno64 authored Dec 2, 2023
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
Expand Up @@ -12,6 +12,8 @@

from resources.lib import kodiutils

import xbmcvfs, glob, shutil

_LOGGER = logging.getLogger(__name__)

IPTV_SIMPLE_ID = 'pvr.iptvsimple'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a1311b3

Please sign in to comment.