From b7250156b43b2be6b73ef6925264372d9018fa39 Mon Sep 17 00:00:00 2001 From: pat-e Date: Thu, 17 Jul 2025 07:48:01 +0200 Subject: [PATCH] Changed the loop to recheck for newly added MKV files --- tv_audio_encoder.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tv_audio_encoder.py b/tv_audio_encoder.py index cab11e5..8e0496f 100644 --- a/tv_audio_encoder.py +++ b/tv_audio_encoder.py @@ -153,16 +153,18 @@ def main(no_downmix=False): DIR_ORIGINAL.mkdir(exist_ok=True, parents=True) current_dir = Path(".") - files_to_process = sorted( - f for f in current_dir.glob("*.mkv") - if not (f.name.endswith(".ut.mkv") or f.name.startswith("temp-") or f.name.startswith("output-")) - ) - if not files_to_process: - print("No .mkv files found to process in the current directory.") - return + while True: + files_to_process = sorted( + f for f in current_dir.glob("*.mkv") + if not (f.name.endswith(".ut.mkv") or f.name.startswith("temp-") or f.name.startswith("output-") ) + ) - for file_path in files_to_process: + if not files_to_process: + print("No more .mkv files found to process in the current directory. The script will now exit.") + break + + file_path = files_to_process[0] print("-" * shutil.get_terminal_size(fallback=(80, 24)).columns) print(f"Starting full processing for: {file_path.name}") date = datetime.now()