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:
@@ -161,7 +161,7 @@ def safe_log_error(message, print_msg=None):
|
||||
|
||||
def encode_dvr(input_file, output_dir, gpu, bitrate):
|
||||
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"
|
||||
|
||||
b_v = f"{bitrate}k"
|
||||
maxrate = f"{bitrate}k"
|
||||
@@ -283,7 +283,7 @@ if __name__ == "__main__":
|
||||
output_dir = "output"
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user