forked from Furumi/furumi-web
Add the matcher and the first two resolver stages of the library import. The matcher is pure: titles are split into a core, featured artists and version tags, taken from the album title too, so a remaster or concert album counts like a marker in the track title. Hard tags (live, remix, edit and similar) must be equal; remaster, mono, stereo, explicit and clean never match automatically. A match without a comparable duration needs the same album, and a single candidate is not a match by itself. Collaborations are split only into known artists, so "Tyler, The Creator" stays one artist. The resolve_local phase matches pending entries by artist group against the library, then against federated tracks this server already knows from searches and from the owner's synced likes and playlists, and stores matched, ambiguous (with up to five candidates) or unmatched decisions under the lease. A local match without a cached content id is hashed with ensure_local_content_id from agent_storage_dir, so local imports are publishable with federation disabled. The network is reached only through a FederationAccess trait and only with the user's consent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>