feat: Bump version to 0.5.5 and update frame class detection logic

This commit is contained in:
sHa
2025-12-30 06:31:51 +00:00
parent a7682bcd24
commit 6b343681a5
6 changed files with 13 additions and 6 deletions

BIN
dist/renamer-0.5.5-py3-none-any.whl vendored Normal file

Binary file not shown.

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "renamer" name = "renamer"
version = "0.5.4" version = "0.5.5"
description = "Terminal-based media file renamer and metadata viewer" description = "Terminal-based media file renamer and metadata viewer"
readme = "README.md" readme = "README.md"
requires-python = ">=3.11" requires-python = ">=3.11"

View File

@@ -193,7 +193,7 @@ SPECIAL_EDITIONS = {
"Workprint": ["Workprint"], "Workprint": ["Workprint"],
"Rough Cut": ["Rough Cut"], "Rough Cut": ["Rough Cut"],
"Special Assembly Cut": ["Special Assembly Cut"], "Special Assembly Cut": ["Special Assembly Cut"],
"Amazon Edition": ["Amazon Edition", "Amazon"], "Amazon Edition": ["Amazon Edition", "Amazon", "AMZN"],
"Netflix Edition": ["Netflix Edition"], "Netflix Edition": ["Netflix Edition"],
"HBO Edition": ["HBO Edition"], "HBO Edition": ["HBO Edition"],
} }

View File

@@ -88,9 +88,10 @@ class MediaInfoExtractor:
# First, try to match width to typical widths # First, try to match width to typical widths
width_matches = [] width_matches = []
for frame_class, info in FRAME_CLASSES.items(): for frame_class, info in FRAME_CLASSES.items():
if width in info['typical_widths'] and frame_class.endswith(scan_type): for tw in info['typical_widths']:
diff = abs(height - info['nominal_height']) if abs(width - tw) <= 5 and frame_class.endswith(scan_type):
width_matches.append((frame_class, diff)) diff = abs(height - info['nominal_height'])
width_matches.append((frame_class, diff))
if width_matches: if width_matches:
# Choose the frame class with the smallest height difference # Choose the frame class with the smallest height difference

View File

@@ -142,5 +142,11 @@
"resolution": [512, 288], "resolution": [512, 288],
"interlaced": false, "interlaced": false,
"expected_frame_class": "288p" "expected_frame_class": "288p"
},
{
"resolution": [1918, 812],
"interlaced": false,
"expected_frame_class": "1080p",
"testname": "test-mistakenly-high-height"
} }
] ]

2
uv.lock generated
View File

@@ -342,7 +342,7 @@ wheels = [
[[package]] [[package]]
name = "renamer" name = "renamer"
version = "0.5.4" version = "0.5.5"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "langcodes" }, { name = "langcodes" },