mirror of
https://github.com/Viren070/MediaFusion.git
synced 2025-12-01 23:21:11 +01:00
Duplicate repository addon data to fix kodi repository not connect issue
This commit is contained in:
@@ -33,20 +33,29 @@ def generate_addons_xml():
|
|||||||
addon_xmls.append(root)
|
addon_xmls.append(root)
|
||||||
except (ET.ParseError, ValueError) as e:
|
except (ET.ParseError, ValueError) as e:
|
||||||
errors.append(f"Error processing {addon_xml_path}: {e}")
|
errors.append(f"Error processing {addon_xml_path}: {e}")
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
raise ValueError("\n".join(errors))
|
raise ValueError("\n".join(errors))
|
||||||
|
|
||||||
# Sort addons by ID for consistent output
|
# Sort addons by ID for consistent output
|
||||||
addon_xmls.sort(key=lambda x: x.get("id", ""))
|
addon_xmls.sort(key=lambda x: x.get("id", ""))
|
||||||
|
|
||||||
# Create addons.xml
|
# Create addons.xml
|
||||||
xml_root = ET.Element("addons")
|
xml_root = ET.Element("addons")
|
||||||
for addon in addon_xmls:
|
for addon in addon_xmls:
|
||||||
|
if addon.get("id").startswith("repository."):
|
||||||
|
# append repository twice
|
||||||
|
xml_root.insert(0, addon)
|
||||||
xml_root.append(addon)
|
xml_root.append(addon)
|
||||||
|
|
||||||
# Use proper XML declaration with encoding
|
# Use proper XML declaration with encoding
|
||||||
xml_str = ET.tostring(xml_root, encoding="utf-8", xml_declaration=True)
|
xml_str = ET.tostring(xml_root, encoding="utf-8", xml_declaration=True)
|
||||||
|
|
||||||
# Save addons.xml
|
# Save addons.xml
|
||||||
addons_xml_path = DIST_DIR / "addons.xml"
|
addons_xml_path = DIST_DIR / "addons.xml"
|
||||||
with open(addons_xml_path, "wb") as f:
|
with open(addons_xml_path, "wb") as f:
|
||||||
f.write(xml_str)
|
f.write(xml_str)
|
||||||
|
|
||||||
# Generate MD5
|
# Generate MD5
|
||||||
md5_path = DIST_DIR / "addons.xml.md5"
|
md5_path = DIST_DIR / "addons.xml.md5"
|
||||||
with open(md5_path, "w") as f:
|
with open(md5_path, "w") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user