diff --git a/renamer/extractors/mediainfo_extractor.py b/renamer/extractors/mediainfo_extractor.py index 2c4ed18..9cdcbd8 100644 --- a/renamer/extractors/mediainfo_extractor.py +++ b/renamer/extractors/mediainfo_extractor.py @@ -90,10 +90,11 @@ class MediaInfoExtractor: effective_height = height # First, try to match width to typical widths + # Use a larger tolerance (10 pixels) to handle cinema/ultrawide aspect ratios width_matches = [] for frame_class, info in FRAME_CLASSES.items(): for tw in info['typical_widths']: - if abs(width - tw) <= 5 and frame_class.endswith(scan_type): + if abs(width - tw) <= 10 and frame_class.endswith(scan_type): diff = abs(height - info['nominal_height']) width_matches.append((frame_class, diff)) diff --git a/renamer/test/datasets/mediainfo/frame_class_tests.json b/renamer/test/datasets/mediainfo/frame_class_tests.json index 531b36c..b376be6 100644 --- a/renamer/test/datasets/mediainfo/frame_class_tests.json +++ b/renamer/test/datasets/mediainfo/frame_class_tests.json @@ -148,5 +148,11 @@ "interlaced": false, "expected_frame_class": "1080p", "testname": "test-mistakenly-high-height" + }, + { + "resolution": [1912,798], + "interlaced": false, + "expected_frame_class": "1080p", + "testname": "test-mistakenly-high-height-2" } ] \ No newline at end of file