Refactor file handling in check_files.py to improve clarity and maintainability. Introduce helper functions for input/output file checks and expected output naming. Update main logic to utilize these functions for better readability. Adjust output file handling in encoding scripts to ensure consistent .mp4 naming convention across all modules.

This commit is contained in:
2026-05-06 19:00:05 -06:00
parent d1221f83b3
commit 3d64eb3094
4 changed files with 70 additions and 49 deletions
+2 -2
View File
@@ -163,7 +163,7 @@ def safe_log_error(message, print_msg=None):
def encode_dvr(input_file, output_dir, gpu):
input_path = Path(input_file)
output_path = Path(output_dir) / f"{input_path.stem}{input_path.suffix}"
output_path = Path(output_dir) / f"{input_path.stem}.mp4"
# Get file info for logging
file_info = get_file_info(str(input_path))
@@ -290,7 +290,7 @@ if __name__ == "__main__":
os.makedirs(output_dir, exist_ok=True)
# Get list of files to process
files = [f for f in os.listdir(input_dir) if f.endswith(('.mp4', '.DVR.mp4'))]
files = [f for f in os.listdir(input_dir) if f.lower().endswith(('.mp4', '.mkv', '.mov'))]
total_files = len(files)
if total_files == 0: