diff --git a/dist/renamer-0.5.5-py3-none-any.whl b/dist/renamer-0.5.5-py3-none-any.whl new file mode 100644 index 0000000..9953884 Binary files /dev/null and b/dist/renamer-0.5.5-py3-none-any.whl differ diff --git a/pyproject.toml b/pyproject.toml index d2ab657..90e5ec7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "renamer" -version = "0.5.4" +version = "0.5.5" description = "Terminal-based media file renamer and metadata viewer" readme = "README.md" requires-python = ">=3.11" diff --git a/renamer/constants.py b/renamer/constants.py index 93f236f..2477835 100644 --- a/renamer/constants.py +++ b/renamer/constants.py @@ -193,7 +193,7 @@ SPECIAL_EDITIONS = { "Workprint": ["Workprint"], "Rough Cut": ["Rough Cut"], "Special Assembly Cut": ["Special Assembly Cut"], - "Amazon Edition": ["Amazon Edition", "Amazon"], + "Amazon Edition": ["Amazon Edition", "Amazon", "AMZN"], "Netflix Edition": ["Netflix Edition"], "HBO Edition": ["HBO Edition"], } diff --git a/renamer/extractors/mediainfo_extractor.py b/renamer/extractors/mediainfo_extractor.py index df780b3..d7a4a86 100644 --- a/renamer/extractors/mediainfo_extractor.py +++ b/renamer/extractors/mediainfo_extractor.py @@ -88,9 +88,10 @@ class MediaInfoExtractor: # First, try to match width to typical widths width_matches = [] for frame_class, info in FRAME_CLASSES.items(): - if width in info['typical_widths'] and frame_class.endswith(scan_type): - diff = abs(height - info['nominal_height']) - width_matches.append((frame_class, diff)) + for tw in info['typical_widths']: + if abs(width - tw) <= 5 and frame_class.endswith(scan_type): + diff = abs(height - info['nominal_height']) + width_matches.append((frame_class, diff)) if width_matches: # Choose the frame class with the smallest height difference diff --git a/renamer/test/test_mediainfo_frame_class.json b/renamer/test/test_mediainfo_frame_class.json index bc176f7..531b36c 100644 --- a/renamer/test/test_mediainfo_frame_class.json +++ b/renamer/test/test_mediainfo_frame_class.json @@ -142,5 +142,11 @@ "resolution": [512, 288], "interlaced": false, "expected_frame_class": "288p" + }, + { + "resolution": [1918, 812], + "interlaced": false, + "expected_frame_class": "1080p", + "testname": "test-mistakenly-high-height" } ] \ No newline at end of file diff --git a/uv.lock b/uv.lock index b6e0bef..6909e35 100644 --- a/uv.lock +++ b/uv.lock @@ -342,7 +342,7 @@ wheels = [ [[package]] name = "renamer" -version = "0.5.4" +version = "0.5.5" source = { editable = "." } dependencies = [ { name = "langcodes" },