Share ISRC canonicalization between matching and conflict reporting #47
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
MatchIndex canonicalizes ISRCs with upper() only. Reporting's isrcs_equal also removes hyphens. The same pair can therefore be considered equivalent in reporting while failing automatic ISRC matching.
Reproduced with local ISRC US-ABC-12-34567 and Apple ISRC USABC1234567, with different metadata to isolate ISRC matching: reporting equality was true and matching returned unmatched.
Proposed change
Define one ISRC canonicalization helper in a suitable shared policy module and use it for both index construction/lookups and conflict reporting. Canonicalization must not rewrite non-empty local metadata.
Acceptance criteria
References:
beetsplug/appleplaylists/matching.py:94-95,111-120,reporting.py:43-56. Audit finding 6 (medium).