From 275134d134b7c9ed6448de1a3ebea3bc4167c2cf Mon Sep 17 00:00:00 2001 From: marco Date: Sat, 18 Apr 2020 23:31:51 +0200 Subject: [PATCH] download-> elimina tutti: cancellazione cartelle --- specials/downloads.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specials/downloads.py b/specials/downloads.py index a430a6a5..6cba9466 100644 --- a/specials/downloads.py +++ b/specials/downloads.py @@ -191,6 +191,9 @@ def clean_all(item): filetools.remove(filetools.join(DOWNLOAD_LIST_PATH, fichero)) if removeFiles: filetools.remove(filetools.join(DOWNLOAD_PATH, download_item.downloadFilename)) + dirName = filetools.join(DOWNLOAD_PATH, filetools.dirname(download_item.downloadFilename)) + if len(filetools.listdir(dirName)) == 0: + filetools.rmdir(dirName) xbmc.sleep(100) platformtools.itemlist_refresh() @@ -208,7 +211,7 @@ def stop_all(item=None): download_item = Item().fromjson(filetools.read(filetools.join(DOWNLOAD_LIST_PATH, fichero))) if download_item.downloadStatus == 4: update_json(filetools.join(DOWNLOAD_LIST_PATH, fichero), {"downloadStatus": STATUS_CODES.stoped}) - xbmc.sleep(100) + xbmc.sleep(300) if item: platformtools.itemlist_refresh()