From bc740a26af95ddc4ec9dc128c7558e0d143b0b98 Mon Sep 17 00:00:00 2001 From: anasty17 Date: Mon, 5 Feb 2024 00:30:56 +0200 Subject: [PATCH] Minor fix Signed-off-by: anasty17 --- bot/helper/listeners/task_listener.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/bot/helper/listeners/task_listener.py b/bot/helper/listeners/task_listener.py index b8769a4246a..1453a31de28 100644 --- a/bot/helper/listeners/task_listener.py +++ b/bot/helper/listeners/task_listener.py @@ -202,10 +202,11 @@ async def onDownloadComplete(self): non_queued_dl.remove(self.mid) non_queued_up.add(self.mid) + self.size = await get_path_size(up_dir) + for s in unwanted_files_size: + self.size -= s + if self.isLeech: - self.size = await get_path_size(up_dir) - for s in unwanted_files_size: - self.size -= s LOGGER.info(f"Leech Name: {self.name}") tg = TgUploader(self, up_dir) async with task_dict_lock: @@ -215,9 +216,6 @@ async def onDownloadComplete(self): tg.upload(unwanted_files, files_to_delete), ) elif is_gdrive_id(self.upDest): - self.size = await get_path_size(up_path) - for s in unwanted_files_size: - self.size -= s LOGGER.info(f"Gdrive Upload Name: {self.name}") drive = gdUpload(self, up_path) async with task_dict_lock: @@ -227,9 +225,6 @@ async def onDownloadComplete(self): sync_to_async(drive.upload, unwanted_files, files_to_delete), ) else: - self.size = await get_path_size(up_path) - for s in unwanted_files_size: - self.size -= s LOGGER.info(f"Rclone Upload Name: {self.name}") RCTransfer = RcloneTransferHelper(self) async with task_dict_lock: