From f9eb571dd868e1f31eab8fecb3b6525939ad3cf4 Mon Sep 17 00:00:00 2001 From: tcely Date: Mon, 24 Mar 2025 12:54:42 -0400 Subject: [PATCH] Resume partial downloads unless the `.clean` file is found --- tubesync/sync/youtube.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tubesync/sync/youtube.py b/tubesync/sync/youtube.py index 65b72e06..1c4fd96e 100644 --- a/tubesync/sync/youtube.py +++ b/tubesync/sync/youtube.py @@ -296,7 +296,10 @@ def download_media( temp_dir_parent = ytopts['paths']['temp'] temp_dir_prefix = f'{temp_dir_prefix}{v_key}-' temp_dir_obj = TemporaryDirectory(prefix=temp_dir_prefix,dir=temp_dir_parent) - temp_dir_path = Path(temp_dir_obj.name) + if temp_dir_obj and (Path(temp_dir_parent) / '.clean').exists(): + temp_dir_path = Path(temp_dir_obj.name) + else: + temp_dir_path = Path(temp_dir_parent) (temp_dir_path / '.ignore').touch(exist_ok=True) ytopts['paths'].update({ 'home': str(output_dir),