diff --git a/INSTALL.md b/INSTALL.md index 8df0f27..0589e63 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -28,7 +28,7 @@ powershell -c "irm https://astral.sh/uv/install.sh | iex" uv tool install https://github.com/shadoll/moma/releases/latest/download/moma-latest.tar.gz # Specific version -uv tool install https://github.com/shadoll/moma/releases/download/v0.9.5/moma-0.9.5-py3-none-any.whl +uv tool install https://github.com/shadoll/moma/releases/download/v0.9.6/moma-0.9.6-py3-none-any.whl # From PyPI (when published) uv tool install moma @@ -40,7 +40,7 @@ uv tool install moma uv tool install --force https://github.com/shadoll/moma/releases/latest/download/moma-latest.tar.gz # Upgrade to a newer specific version -uv tool install --force https://github.com/shadoll/moma/releases/download/v0.9.5/moma-0.9.5-py3-none-any.whl +uv tool install --force https://github.com/shadoll/moma/releases/download/v0.9.6/moma-0.9.6-py3-none-any.whl ``` #### Usage @@ -56,7 +56,7 @@ moma /path/to/directory # Scan specific directory pip install https://github.com/shadoll/moma/releases/latest/download/moma-latest.tar.gz # Specific version -pip install https://github.com/shadoll/moma/releases/download/v0.9.5/moma-0.9.5-py3-none-any.whl +pip install https://github.com/shadoll/moma/releases/download/v0.9.6/moma-0.9.6-py3-none-any.whl ``` ### Method 3: Development Installation diff --git a/pyproject.toml b/pyproject.toml index f0ab710..21e0f0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "moma" -version = "0.9.5" +version = "0.9.6" description = "Terminal-based media file renamer and metadata viewer" readme = "README.md" requires-python = ">=3.12" diff --git a/src/extractors/mediainfo_extractor.py b/src/extractors/mediainfo_extractor.py index a25daf8..c21ddb5 100644 --- a/src/extractors/mediainfo_extractor.py +++ b/src/extractors/mediainfo_extractor.py @@ -249,11 +249,14 @@ 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 + # Use proportional tolerance (2% of typical width, min 10px) to handle + # cinema/ultrawide aspect ratios where encoded width may differ slightly + # (e.g. 3820×1592 scope 4K → 2160p, not a non-standard 1592p) width_matches = [] for frame_class, info in FRAME_CLASSES.items(): for tw in info["typical_widths"]: - if abs(width - tw) <= 10 and frame_class.endswith(scan_type): + width_tolerance = max(10, int(tw * 0.02)) + if abs(width - tw) <= width_tolerance and frame_class.endswith(scan_type): diff = abs(height - info["nominal_height"]) width_matches.append((frame_class, diff)) diff --git a/src/test/datasets/mediainfo/frame_class_tests.json b/src/test/datasets/mediainfo/frame_class_tests.json index b376be6..7fd841c 100644 --- a/src/test/datasets/mediainfo/frame_class_tests.json +++ b/src/test/datasets/mediainfo/frame_class_tests.json @@ -154,5 +154,12 @@ "interlaced": false, "expected_frame_class": "1080p", "testname": "test-mistakenly-high-height-2" + }, + { + "testname": "test-2160p-scope-240", + "resolution": [3820, 1592], + "interlaced": false, + "expected_frame_class": "2160p", + "description": "4K cinema scope 2.40:1 - width slightly under 3840, height non-standard 1592" } ] \ No newline at end of file diff --git a/uv.lock b/uv.lock index 04d2160..8fe6d56 100644 --- a/uv.lock +++ b/uv.lock @@ -208,7 +208,7 @@ wheels = [ [[package]] name = "moma" -version = "0.9.5" +version = "0.9.6" source = { editable = "." } dependencies = [ { name = "langcodes" },