mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-03-10 08:29:00 +00:00
Fix
This commit is contained in:
@@ -70,22 +70,21 @@ class Movie(Title):
|
|||||||
def _get_resolution_token(track: Any) -> str:
|
def _get_resolution_token(track: Any) -> str:
|
||||||
if not track or not getattr(track, "height", None):
|
if not track or not getattr(track, "height", None):
|
||||||
return ""
|
return ""
|
||||||
resolution = track.height
|
width = getattr(track, "width", track.height)
|
||||||
|
resolution = min(width, track.height)
|
||||||
try:
|
try:
|
||||||
dar = getattr(track, "other_display_aspect_ratio", None) or []
|
dar = getattr(track, "other_display_aspect_ratio", None) or []
|
||||||
if dar and dar[0]:
|
if dar and dar[0]:
|
||||||
aspect_ratio = [int(float(plane)) for plane in str(dar[0]).split(":")]
|
aspect_ratio = [int(float(plane)) for plane in str(dar[0]).split(":")]
|
||||||
if len(aspect_ratio) == 1:
|
if len(aspect_ratio) == 1:
|
||||||
aspect_ratio.append(1)
|
aspect_ratio.append(1)
|
||||||
if aspect_ratio[0] / aspect_ratio[1] not in (16 / 9, 4 / 3):
|
ratio = aspect_ratio[0] / aspect_ratio[1]
|
||||||
resolution = int(track.width * (9 / 16))
|
if ratio not in (16 / 9, 4 / 3, 9 / 16, 3 / 4):
|
||||||
|
resolution = int(max(width, track.height) * (9 / 16))
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
scan_suffix = "p"
|
scan_suffix = "i" if str(getattr(track, "scan_type", "")).lower() == "interlaced" else "p"
|
||||||
scan_type = getattr(track, "scan_type", None)
|
|
||||||
if scan_type and str(scan_type).lower() == "interlaced":
|
|
||||||
scan_suffix = "i"
|
|
||||||
return f"{resolution}{scan_suffix}"
|
return f"{resolution}{scan_suffix}"
|
||||||
|
|
||||||
# Name (Year)
|
# Name (Year)
|
||||||
|
|||||||
Reference in New Issue
Block a user