- Rework Settings tab into grouped sections - Add preferred-region matching and full-hash-by-default setting - Replace combo-box square arrow with a proper chevron - Fix UMD Refresh button (clicked bool was clearing the view) - Remove pkg2zip.exe fallback (pure-Python decryptor is the primary path) - Move LAN IP/share paths to .env; use example defaults in config
17 lines
803 B
Python
17 lines
803 B
Python
"""High-level identification: match + canonical naming for one scanned disc."""
|
|
from . import iso_reader, matcher, namer
|
|
|
|
|
|
def identify(conn, record, prefer_region=None):
|
|
"""Return ``{method, release, serial, canonical}`` for a scanned disc record."""
|
|
method, release = matcher.match(conn, record, prefer_region=prefer_region)
|
|
return identify_with_release(record, release, method)
|
|
|
|
|
|
def identify_with_release(record, release, method):
|
|
serial = record.get("serial")
|
|
if not serial and release and iso_reader.looks_like_serial(release.get("serial")):
|
|
serial = iso_reader.normalize_serial(release.get("serial"))
|
|
canonical = namer.canonical_name(release, serial) if release else None
|
|
return {"method": method, "release": release, "serial": serial, "canonical": canonical}
|