Fix file sort when tags applied

This commit is contained in:
Anton Vakhrushev 2025-04-26 17:27:28 +03:00
parent 8dafbccef1
commit 3804171708
Signed by: av
GPG Key ID: F5BF52FC352E255A
2 changed files with 11 additions and 3 deletions

View File

@ -12,7 +12,10 @@ def create_convert_parser(subparsers):
epilog="Example: python convert_encoding.py /path/to/directory", epilog="Example: python convert_encoding.py /path/to/directory",
) )
parser.add_argument( parser.add_argument(
"directory", type=str, help="Path to target directory for conversion" "--directory",
type=str,
help="Path to target directory for conversion",
default=".",
) )
parser.set_defaults(func=convert_file_encoding.execute) parser.set_defaults(func=convert_file_encoding.execute)
@ -23,7 +26,10 @@ def create_split_parser(subparsers):
description="Разделение FLAC-файла по CUE с переносом оригинала во временную директорию", description="Разделение FLAC-файла по CUE с переносом оригинала во временную директорию",
) )
parser.add_argument( parser.add_argument(
"directory", type=str, help="Path to target directory with flac and cue files" "--directory",
type=str,
help="Path to target directory with flac and cue files",
default=".",
) )
parser.set_defaults(func=split_flac.execute) parser.set_defaults(func=split_flac.execute)

View File

@ -69,7 +69,9 @@ def process_directory(directory):
# Добавление метаданных # Добавление метаданных
print("Add tags from CUE-file...") print("Add tags from CUE-file...")
split_files = [f for f in os.listdir(directory) if f.endswith(".flac")] split_files = sorted(
[f for f in os.listdir(directory) if f.endswith(".flac")]
)
if split_files: if split_files:
subprocess.run( subprocess.run(