Problem
Search is per source today. A user who has the local library and several Streaming Sources must search each one separately.
Some services, such as Spotify and Apple Music, offer catalogs, playlists, and ISRCs but no full-length non-DRM audio. A Streaming Source for them could browse but every media.resolve would be an Import Refusal. Projects such as riff and yoink solve this by matching title and artist on another service inside the same adapter. Inside a package, that hides the match from the user and records the wrong Streaming Track Identity.
Proposal
Three parts, in order.
1. Global search
One search box queries the local library and the search method of every enabled Streaming Source at once. Results are grouped by origin. Each result keeps its own source and id; picking one runs the normal Online Preview or Streaming Import. Slow or failing sources do not block the others. This needs no protocol change.
2. isrc on Track (protocol 2.1)
Add an optional isrc: string | null to Track. This is an additive minor change. Sources that know it (Spotify external_ids.isrc, Apple Music catalog, Deezer) fill it in; others return null. The host validates the format (12 characters, [A-Z]{2}[A-Z0-9]{3}[0-9]{7}) and drops invalid values.
3. Playable Match in the host
When the user picks a track that its source refuses with no_media, OpenKara offers to find a playable version:
- The host searches the other enabled, signed-in Streaming Sources with the track's metadata.
- It ranks candidates: same ISRC first, then title, artists, and duration within a tolerance. Candidates whose title marks a different cut (live, remix, instrumental, karaoke) rank below exact cuts unless the original has the same mark.
- The user confirms a candidate. The UI shows title, artist, album, duration, and source for the original and the candidate. A same-ISRC candidate may be preselected but still shows what was chosen.
- Streaming Import proceeds on the candidate through the shared import path. The library song gets the candidate's Streaming Track Identity. The original track is kept only as "matched from" metadata, not as an identity.
Packages stay honest: a source returns only its own media and never searches other services. Matching lives in one host module with tests, and the user sees every choice.
Playlist flow: a Streaming Import of a Streaming Playlist from a metadata-only source runs Playable Match per track and lists unmatched tracks with the reason, the same way Import Refusals are listed today.
Conflicts with existing decisions
- ADR 0035 says: "A later 'search this title on another signed-in Streaming Source' feature is a new product surface." This issue is that surface. It still ships no UNM engine and adds no replacement audio service; it only matches across sources the user installed. The ADR 0035 licence reason (GPL vs Apache) no longer applies since ADR 0032 (AGPL), but no UNM code is needed.
- CONTEXT.md rule "Title and artist are display fields. They do not decide whether two imports are the same song." stays true: matching picks a candidate for the user to confirm; library identity is still the candidate's Streaming Track Identity plus file hash.
- The protocol rule "The host does not fall back to another source, even for a matching title" (
Resolution) stays true for automatic resolution. Playable Match is an explicit user action, not a silent fallback. - New glossary term: Playable Match (可播放匹配). A user-confirmed choice of a track on another Streaming Source to import in place of a track whose source has no media. Avoid: UNM, unblock, fallback, auto-replace.
An ADR records parts 2 and 3 when the work lands.
Out of scope
- Packages that resolve media from origins of another service.
- Silent automatic replacement without user confirmation.
- YouTube or other Video Sources as audio candidates (ADR 0036).
- Writing a Spotify or Apple Music source package. That belongs in
openkara-sourcesand can follow part 2.
Open questions
- Should a confirmed Playable Match be remembered, so the same original track resolves to the same candidate next time without asking?
- Which Playlist Origin Stamp does a matched playlist import get: the original playlist, or none?
- Duration tolerance: a fixed ±3 s, or relative to track length?