diff --git a/bot/utils/os_utils.py b/bot/utils/os_utils.py index 5c29539b..b08577e9 100644 --- a/bot/utils/os_utils.py +++ b/bot/utils/os_utils.py @@ -65,8 +65,15 @@ def check_ext(path, ext=".mkv", get_split=False, overide=False): return path -def s_remove(*filenames): +def s_remove(*filenames, folders=False): """Deletes a single or tuple of files silently and return no errors if not found""" + if folders: + for _dir in filenames: + try: + Path(_dir).rmdir() + except Exception: + pass + return for filename in filenames: try: os.remove(filename) diff --git a/bot/workers/handlers/rebut.py b/bot/workers/handlers/rebut.py index cd08222c..90b50e63 100644 --- a/bot/workers/handlers/rebut.py +++ b/bot/workers/handlers/rebut.py @@ -805,6 +805,7 @@ async def en_upload(event, args, client): finally: if download: await download.clean_download() + s_remove(folder, folders=True) async def en_list(event, args, client): diff --git a/version.txt b/version.txt index c1a26396..c8300217 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v2.2.0-beta.0.5.03 (beta) +v2.2.0-beta.0.5.04 (beta)