diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 3c8399b6..8c7193d3 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1358,8 +1358,7 @@ def play_torrent(item, xlistitem, mediaurl): # Si es Libtorrent y no está soportado, se ofrecen alternativas, si las hay... if len(torrent_options) == 0: from specials import elementum_download - if dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70782)): - elementum_download.download() + if elementum_download.download(): torrent_options = torrent_client_installed(show_tuple=True) else: return diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index df6ec62f..e75aa764 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -5900,7 +5900,7 @@ msgid "You must install an external Client to take advantage of the torrent supp msgstr "" msgctxt "#70783" -msgid "Elementum installed and configured, enjoy!" +msgid "Elementum is installed on your device, but is not active. Do you want to activate it?" msgstr "" msgctxt "#70784" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index c6f64d09..e7a700a9 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -5900,8 +5900,8 @@ msgid "You must install an external Client to take advantage of the torrent supp msgstr "Per poter usufruire del support torrent devi installare un Client esterno. Vuoi installare Elementum?" msgctxt "#70783" -msgid "Elementum installed and configured, enjoy!" -msgstr "Elementum installato e configurato, buona Visione!" +msgid "Elementum is installed on your device, but is not active. Do you want to activate it?" +msgstr "Elementum è installato sul tuo dispositivo, ma non è attivo. Vuoi Attivarlo?" msgctxt "#70784" msgid "Attention!" diff --git a/specials/elementum_download.py b/specials/elementum_download.py index a93e309f..fa05e42f 100644 --- a/specials/elementum_download.py +++ b/specials/elementum_download.py @@ -1,59 +1,78 @@ from core import filetools, downloadtools, support from platformcode import config, platformtools, updater -from time import sleep - -import xbmc, xbmcaddon, os, sys, platform +import xbmc, xbmcaddon, sys, platform host = 'https://github.com' elementum_url = host + '/elgatito/plugin.video.elementum/releases' filename = filetools.join(config.get_data_path(),'elementum.zip') -addon_path = xbmc.translatePath("special://home/addons/") +addon_path = xbmc.translatePath('special://home/addons/') +setting_path = xbmc.translatePath('special://profile/addon_data/') elementum_path = filetools.join(addon_path,'plugin.video.elementum') +elementum_setting = filetools.join(setting_path,'plugin.video.elementum') +elementum_setting_file = filetools.join(elementum_setting,'settings.xml') +kod_setting_file = filetools.join(addon_path,'plugin.video.kod', 'resources', 'settings', 'elementum', 'settings.xml') def download(item=None): - if filetools.exists(elementum_path): - xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "plugin.video.elementum", "enabled": false }}') - sleep(1) - filetools.rmdirtree(elementum_path) - if filetools.exists(filename): - filetools.remove(filename) - return download() + if filetools.exists(elementum_path): + if platformtools.dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70783)): + setting() + return True + else: - platform = get_platform() - support.log('OS:', platform) - support.log('Extract IN:', elementum_path) - url = support.match(elementum_url, patronBlock=r'
(.*?)', patron=r'(.*?)', patron=r'