From 30269b6c17db9134246be1848d8e0816462ace4c Mon Sep 17 00:00:00 2001 From: CodeName393 Date: Thu, 26 Feb 2026 02:07:06 +0900 Subject: [PATCH] Fix --- unshackle/core/titles/movie.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/unshackle/core/titles/movie.py b/unshackle/core/titles/movie.py index d14df3e..3eb0b50 100644 --- a/unshackle/core/titles/movie.py +++ b/unshackle/core/titles/movie.py @@ -70,22 +70,21 @@ class Movie(Title): def _get_resolution_token(track: Any) -> str: if not track or not getattr(track, "height", None): return "" - resolution = track.height + width = getattr(track, "width", track.height) + resolution = min(width, track.height) try: dar = getattr(track, "other_display_aspect_ratio", None) or [] if dar and dar[0]: aspect_ratio = [int(float(plane)) for plane in str(dar[0]).split(":")] if len(aspect_ratio) == 1: aspect_ratio.append(1) - if aspect_ratio[0] / aspect_ratio[1] not in (16 / 9, 4 / 3): - resolution = int(track.width * (9 / 16)) + ratio = aspect_ratio[0] / aspect_ratio[1] + if ratio not in (16 / 9, 4 / 3, 9 / 16, 3 / 4): + resolution = int(max(width, track.height) * (9 / 16)) except Exception: pass - scan_suffix = "p" - scan_type = getattr(track, "scan_type", None) - if scan_type and str(scan_type).lower() == "interlaced": - scan_suffix = "i" + scan_suffix = "i" if str(getattr(track, "scan_type", "")).lower() == "interlaced" else "p" return f"{resolution}{scan_suffix}" # Name (Year)