Fix download cleanup
Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
parent
c0a446749a
commit
7ebd051ed3
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue