Find handed-off Tracks in a Source's catalog by ISRC #53
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SBDeveloper/medley#53
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?
Part of #49
During a Handoff the receiving Device looks for an equivalent Track by ISRC and by similar title/artist/duration, but only in its Library. A local file on the PC that the phone has no copy of is skipped, even when the phone is logged in to Deezer and Deezer has the same recording.
Wanted: when a handed-off Track does not resolve in the Library, ask the receiving Device's catalog Sources for a Track with the same ISRC (and only then fall back to skipping). Played-as-similar and skipped Tracks keep being listed in the notice.
Needs a way for a Source to look a Track up by ISRC: a new optional export in the plugin API (
crates/plugin-api), implemented by the Deezer plugin. Consider the cost: one lookup per unresolved Track, and the Handoff must still get ready within its timeout (resolve the current Track first, or batch).See ADR 0009 and the resolution in
crates/core/src/handoff.rs.Agent Brief
Category: enhancement
Summary: During Handoff, resolve Tracks the receiving Device lacks by looking them up by ISRC in its usable Sources' catalogs, before falling back to similarity or skipping.
Current behavior:
The receiving Device resolves each handed-off Queue entry: same Source and Track id (catalog Source logged in, or Track in Library), else a Library Track with the same ISRC, else a Library Track with similar title/artist/duration, else skipped. A local file from the other Device with an ISRC is skipped even when a logged-in catalog Source has the same recording. The plugin API has no lookup-by-ISRC export.
Desired behavior:
track_by_isrcand is usable here (logged in if it has an account), in Source ranking order; first hit wins.Same: no entry in the "played as similar" notice. It plays as a catalog Track and is not added to the Library.prepare; Tracks still unresolved when the budget runs out fall through to similarity, then skipped, as today. Results are cached per Track reference within one Handoff (as already done).HANDOFF_TIMEOUT(10s).Key interfaces:
track_by_isrc, input{isrc}, outputTrackor null. Add it to the export tables in the crate docs next tocontinuation. A Source without it is simply never asked.Source: a way to call it and tell whether a Source exports it.track_by_isrcusing Deezer's lookup by ISRC; return the same Track shape assearch/track.Resolved::Samecarrying a non-Library Track) must keep playing correctly when the Track is not in the Library.fake-sourceshould export it so core integration tests can drive it.Acceptance criteria:
preparereturns within the budget plus resolving overhead and unresolved Tracks are skipped.track_by_isrcand returns a Track for a known ISRC (fixture-based test).Out of scope: