fix(ffmpeg_handling): fix return value for remove russian only files

This commit is contained in:
Lucas Vivo committed 2026-10-27 08:23:09 +01:00
1 parent b9735e9381
commit 3f19182d35
1 file changed
+7 -3
+7 -3
View File
@@ -18,7 +18,6 @@ from pathlib import Path
import ffmpeg import ffmpeg
from mutagen.easyid3 import EasyID3 from mutagen.easyid3 import EasyID3
from serverlibrary import * from serverlibrary import *
logging.setLoggerClass(CustomLogger) logging.setLoggerClass(CustomLogger)
@@ -446,6 +445,8 @@ def cmd_info(args):
except ffmpeg.Error as e: except ffmpeg.Error as e:
logger.error("Error probing file:", e) logger.error("Error probing file:", e)
return False, "nooutputneeded"
def cmd_convert_av(args): def cmd_convert_av(args):
""" """
@@ -1159,6 +1160,7 @@ def cmd_test(args):
test_files = [ test_files = [
"test_auto.mkv", "test_auto.mkv",
"test_auto.mp4", "test_auto.mp4",
"test_auto_only_russian.mkv",
"test_auto_no_subs.mkv", "test_auto_no_subs.mkv",
"test_auto_no_subs.mp4", "test_auto_no_subs.mp4",
] ]
@@ -1177,7 +1179,7 @@ def cmd_test(args):
_test_dict = [] _test_dict = []
logger.info(f"TEST: {name}") logger.info(f"TEST: {name}")
# Run FFmpeg for this single command only # Run FFmpeg for this single command only
outputs = cmd_func(args_probe) return_value ,outputs = cmd_func(args_probe)
if not outputs: if not outputs:
logger.error("No outputs returned.") logger.error("No outputs returned.")
return False return False
@@ -1195,7 +1197,7 @@ def cmd_test(args):
# Probe result file(s) # Probe result file(s)
out_files = [] out_files = []
if hasattr(args_probe, "output") and args_probe.output: if hasattr(args_probe, "output") and args_probe.output and return_value:
out_files.append(args_probe.output) out_files.append(args_probe.output)
for idx, file in enumerate(out_files): for idx, file in enumerate(out_files):
@@ -1209,6 +1211,7 @@ def cmd_test(args):
logger.error(f"{red_tag('FAIL')} Probe error: {file}") logger.error(f"{red_tag('FAIL')} Probe error: {file}")
logger.error(e) logger.error(e)
return False return False
return True
def is_cover_art(stream): def is_cover_art(stream):
if stream["codec_type"] != "video": if stream["codec_type"] != "video":
@@ -1468,6 +1471,7 @@ def cmd_test(args):
Path(test_dir) Path(test_dir)
/ f"out_{str(cmd['name']).replace('-', '_')}_{Path(test_file).stem}{Path(test_file).suffix}" / f"out_{str(cmd['name']).replace('-', '_')}_{Path(test_file).stem}{Path(test_file).suffix}"
) )
ret = ret and run_and_probe( ret = ret and run_and_probe(
cmd["name"], cmd_remove_audio_track, args_test, test_dict cmd["name"], cmd_remove_audio_track, args_test, test_dict
) )