Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
Signed-off-by: anasty17 <[email protected]>
  • Loading branch information
anasty17 committed Feb 4, 2024
1 parent 016ad2c commit bc740a2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions bot/helper/listeners/task_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit bc740a2

Please sign in to comment.