diff --git a/platformcode/elementum_download.py b/platformcode/elementum_download.py index 53c1ed8a..588543fc 100644 --- a/platformcode/elementum_download.py +++ b/platformcode/elementum_download.py @@ -18,6 +18,9 @@ def download(item=None): if filetools.exists(elementum_path): if platformtools.dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70783)): + addon_file = filetools.file_open(filetools.join(elementum_path,'addon.xml')).read() + required = support.match(addon_file, patron=r'addon="([^"]+)').matches + for r in required: xbmc.executebuiltin('InstallAddon(' + r + ')', wait=True) setting() platformtools.dialog_ok('Elementum', config.get_localized_string(70783)) @@ -32,6 +35,9 @@ def download(item=None): downloadtools.downloadfile(host + url, filename) extract() xbmc.sleep(1000) + addon_file = filetools.file_open(filetools.join(elementum_path,'addon.xml')).read() + required = support.match(addon_file, patron=r'addon="([^"]+)').matches + for r in required: xbmc.executebuiltin('InstallAddon(' + r + ')', wait=True) setting() @@ -40,8 +46,8 @@ def extract(): from platformcode.updater import fixZipGetHash support.info('Estraggo Elementum in:', elementum_path) try: - hash = fixZipGetHash(filename) - support.info(hash) + # hash = fixZipGetHash(filename) + # support.info(hash) with zipfile.ZipFile(filetools.file_open(filename, 'rb', vfs=False)) as zip_ref: zip_ref.extractall(xbmc.translatePath(addon_path)) diff --git a/platformcode/launcher.py b/platformcode/launcher.py index 7e279c37..d16ddf26 100644 --- a/platformcode/launcher.py +++ b/platformcode/launcher.py @@ -129,6 +129,10 @@ def run(item=None): from platformcode import backup return getattr(backup, item.action)(item) + elif item.channel == "elementum_download": + from platformcode import elementum_download + return getattr(elementum_download, item.action)(item) + elif item.channel == "shortcuts": from platformcode import shortcuts return getattr(shortcuts, item.action)(item)