This commit is contained in:
Erwin Broekhuis 2026-04-21 12:19:15 +02:00 committed by GitHub
commit c6d3855739
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -1159,9 +1159,9 @@ def get_themes(api_client):
if not xbmcvfs.exists(library + "/"):
xbmcvfs.mkdir(library)
if xbmc.getCondVisibility("System.HasAddon(script.tvtunes)"):
if xbmc.getCondVisibility("System.HasAddon(service.tvtunes)"):
tvtunes = xbmcaddon.Addon(id="script.tvtunes")
tvtunes = xbmcaddon.Addon(id="service.tvtunes")
tvtunes.setSetting("custom_path_enable", "true")
tvtunes.setSetting("custom_path", library)
LOG.info("TV Tunes custom path is enabled and set.")
@ -1197,9 +1197,12 @@ def get_themes(api_client):
items[item["Id"]] = folder
for item in items:
folder_name = items[item]
if isinstance(folder_name, bytes):
folder_name = folder_name.decode("utf-8")
nfo_path = os.path.join(library, items[item])
nfo_file = os.path.join(nfo_path, "tvtunes.nfo")
nfo_path = os.path.join(str(library), folder_name)
nfo_file = os.path.join(str(nfo_path), "tvtunes.nfo")
if not xbmcvfs.exists(nfo_path):
xbmcvfs.mkdir(nfo_path)

View file

@ -26,7 +26,7 @@ def tvtunes_nfo(path, urls):
except Exception:
xml = etree.Element("tvtunes")
for elem in xml.getiterator("tvtunes"):
for elem in xml.iter("tvtunes"):
for file in list(elem):
elem.remove(file)