Fix download cleanup

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2019-09-28 18:24:27 +05:30
parent c0a446749a
commit 7ebd051ed3
2 changed files with 3 additions and 5 deletions

View File

@ -31,7 +31,7 @@ class DownloadStatus:
return self.__download.name
def path(self):
return "{}{}/{}".format(DOWNLOAD_DIR, self.__uid, self.name())
return "{}{}".format(DOWNLOAD_DIR, self.__uid)
def size(self):
return self.__download.total_length_string()

View File

@ -8,10 +8,8 @@ import mimetypes
def clean_download(path: str):
if os.path.exists(path):
if os.path.isfile(path):
os.remove(path)
else:
shutil.rmtree(path)
LOGGER.info("Cleaning download: {}".format(path))
shutil.rmtree(path)
def exit_clean_up(signal, frame):