From 961f48b8593999c74fd76b7d4cbb3c6b70e1d838 Mon Sep 17 00:00:00 2001 From: marcin <6998565+3h4x@users.noreply.github.com> Date: Thu, 21 Jul 2022 14:35:40 +0200 Subject: [PATCH] feat: improve series naming --- src/rename_series.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rename_series.py b/src/rename_series.py index 60ae529..04ea7c6 100644 --- a/src/rename_series.py +++ b/src/rename_series.py @@ -120,21 +120,21 @@ def rename_series(ctx, path, force): file_name = find_most_apt(file_name, series) file_name = removeIllegal(file_name).strip() - Final = f"SE{season}EP{episode} - {file_name}{extension}" + output_name = f"{file_name} S{season}E{episode}{extension}" path_output = os.path.join(file_name, f"Season {int(season)}") # type: ignore subprocess.check_call(f'mkdir -p "{path_output}"', cwd=path, shell=True) try: - if force or click.confirm(f'Rename "{file}" to "{Final}"?', default=True): + if force or click.confirm(f'Rename "{file}" to "{output_name}"?', default=True): # cross device mv subprocess.check_call( - f'mv "{file}" "{os.path.join(path_output, Final)}"', + f'mv "{file}" "{os.path.join(path_output, output_name)}"', cwd=path, shell=True, ) except FileExistsError: - print(f"Error - File Already Exist: {Final}") + print(f"Error - File Already Exist: {output_name}") click.echo("All Files Processed...")