From 94bd2f37017bb9c4aa4670a37665208712f0b03e Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 14 May 2020 10:51:06 +0200 Subject: [PATCH] =?UTF-8?q?Resta=20in=20Seed:=20se=20questa=20opzione=20?= =?UTF-8?q?=C3=A8=20attiva=20il=20file=20resta=20in=20seed=20finch=C3=A9?= =?UTF-8?q?=20non=20viene=20eliminato=20dalla=20lista=20dei=20download?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/language/English/strings.po | 8 ++++++++ resources/language/Italian/strings.po | 8 ++++++++ resources/settings.xml | 3 ++- servers/torrent.py | 4 ++-- service.py | 4 ++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po index bc8b591e..ef77d7d2 100644 --- a/resources/language/English/strings.po +++ b/resources/language/English/strings.po @@ -6003,6 +6003,14 @@ msgctxt "#70804" msgid "Next extraction..." msgstr "" +msgctxt "#70805" +msgid "Stay on seed" +msgstr "" + +msgctxt "#70806" +msgid "Changing this parameter permanently overwrites the Elementum settings.\nAre you sure you want to continue?" +msgstr "" + # DNS start [ settings and declaration ] msgctxt "#707401" msgid "Enable DNS check alert" diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po index 918b46f4..56955d91 100644 --- a/resources/language/Italian/strings.po +++ b/resources/language/Italian/strings.po @@ -6003,6 +6003,14 @@ msgctxt "#70804" msgid "Next extraction..." msgstr "Estrazione successiva..." +msgctxt "#70805" +msgid "Stay on seed" +msgstr "Resta in seed" + +msgctxt "#70806" +msgid "Changing this parameter permanently overwrites the Elementum settings.\nAre you sure you want to continue?" +msgstr "Modificando questo parametro vengono sovrascritte permanentemente le impostazioni di Elementum.\nSicuro di Voler continuare?" + # DNS start [ settings and declaration ] msgctxt "#707401" msgid "Enable DNS check alert" diff --git a/resources/settings.xml b/resources/settings.xml index 3d108c2b..9730fbff 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -69,7 +69,8 @@ - + + diff --git a/servers/torrent.py b/servers/torrent.py index b13091d3..94401d3e 100755 --- a/servers/torrent.py +++ b/servers/torrent.py @@ -113,7 +113,7 @@ def elementum_monitor(): jsontools.update_node(4, Monitor[name]['file'], 'downloadStatus', path, silent=True) if status in ['Paused']: jsontools.update_node(0, Monitor[name]['file'], 'downloadStatus', path, silent=True) - if status in ['Seeding', 'Finished']: + if status in ['Seeding', 'Finished'] and not config.get_setting('elementum_on_seed'): monitor_update(TorrentPath, name, remove=True) dlJson = jsontools.load(open(filetools.join(path, Monitor[name]['file']), "r").read()) jsontools.update_node(dlJson['downloadSize'], Monitor[name]['file'], 'downloadCompleted', path, silent=True) @@ -200,7 +200,7 @@ def find_file(hash): def elementum_actions(parameter, TorrentHash): elementum_setting, elementum_host, TorrentPath = setting() if elementum_setting: - if parameter == 'delete' : monitor_update(TorrentPath, TorrentHash, remove=True) + if parameter == 'delete': monitor_update(TorrentPath, TorrentHash, remove=True) requests.get('%s/%s/%s' %(elementum_host, parameter, TorrentHash)) diff --git a/service.py b/service.py index 01166fbb..b9bf33a9 100644 --- a/service.py +++ b/service.py @@ -342,6 +342,10 @@ class AddonMonitor(xbmc.Monitor): schedule.clear('videolibrary') self.scheduleVideolibrary() + if self.settings_pre.get('elementum_on_seed') != settings_post.get('elementum_on_seed') and settings_post.get('elementum_on_seed'): + if not platformtools.dialog_yesno(config.get_localized_string(70805), config.get_localized_string(70806)): + config.set_setting('elementum_on_seed', False) + self.settings_pre = settings_post def onScreensaverActivated(self):