From 124d752aa49fc4c26fd861d72d10fbfd2fe25ab5 Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Tue, 4 Jun 2024 07:38:20 -0600 Subject: [PATCH] Clean up file paths for easier reading. --- subgen.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subgen.py b/subgen.py index fef57f5..9daeb66 100644 --- a/subgen.py +++ b/subgen.py @@ -572,15 +572,15 @@ def gen_subtitles_queue(file_path: str, transcription_type: str, force_language= if not has_audio(file_path): logging.debug(f"{file_path} doesn't have any audio to transcribe!") return - + message = None if has_subtitle_language(file_path, skipifinternalsublang): message = f"{file_path} already has an internal subtitle we want, skipping generation" - elif os.path.exists(file_path.rsplit('.', 1)[0] + subextension): + elif os.path.exists(get_file_name_without_extension(file_path) + subextension): message = f"{file_path} already has a subtitle created for this, skipping it" - elif os.path.exists(file_path.rsplit('.', 1)[0] + subextensionSDH): + elif os.path.exists(get_file_name_without_extension(file_path) + subextensionSDH): message = f"{file_path} already has a SDH subtitle created for this, skipping it" - elif os.path.exists(file_path.rsplit('.', 1)[0] + '.lrc'): + elif os.path.exists(get_file_name_without_extension(file_path) + '.lrc'): message = f"{file_path} already has a LRC created for this, skipping it" if message: logging.info(message)