From a728fab2739323724a86a9b26a8492a4a3a27c16 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 15 Apr 2020 14:06:50 +0200 Subject: [PATCH] library_move di default e cancellazione json a download completo --- resources/settings.xml | 2 +- specials/downloads.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/settings.xml b/resources/settings.xml index 808c2394..a74d16fb 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -97,7 +97,7 @@ - + diff --git a/specials/downloads.py b/specials/downloads.py index 0f3c3c48..36dfd100 100644 --- a/specials/downloads.py +++ b/specials/downloads.py @@ -669,7 +669,7 @@ def download_from_url(url, item): save_server_statistics(item.server, d.speed[0], d.state != d.states.error) - if status == STATUS_CODES.completed and config.get_setting("library_move") == True: + if status == STATUS_CODES.completed and config.get_setting("videolibrary_kodi") and config.get_setting("library_move"): move_to_libray(item.clone(downloadFilename=file)) return {"downloadUrl": d.download_url, "downloadStatus": status, "downloadSize": d.size[0], @@ -860,7 +860,11 @@ def start_download(item): # No tenemos server, necesitamos buscar el mejor else: ret = download_from_best_server(item) - update_json(item.path, ret) + + if ret["downloadStatus"] == STATUS_CODES.completed and config.get_setting("videolibrary_kodi") and config.get_setting("library_move"): + filetools.remove(item.path) + else: + update_json(item.path, ret) return ret["downloadStatus"]