feat(library): remote browse status + save/materialize API (§Phase2-3)
Search results now report whether a hit is already saved (in_library,
track_id, availability). New RemoteLibraryService backs POST
/tracks/remote (idempotent placeholder save) and POST
/tracks/{id}/materialize (on-demand fetch via a new materialize_track
arq task, reusing in-flight jobs).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,17 @@ async def enqueue_download(job_id: uuid.UUID) -> None:
|
||||
log.warning("download_enqueue_failed", job_id=str(job_id))
|
||||
|
||||
|
||||
async def enqueue_materialize(job_id: uuid.UUID) -> None:
|
||||
"""Best-effort enqueue of a materialize job for the worker (plan: Model C
|
||||
lazy materialization). Same deferred-commit reasoning as
|
||||
:func:`enqueue_download` — the job row stays ``queued`` and can be retried
|
||||
if the queue is unreachable."""
|
||||
try:
|
||||
await enqueue("materialize_track", job_id=str(job_id), _defer_by=3)
|
||||
except DependencyUnavailableError:
|
||||
log.warning("materialize_enqueue_failed", job_id=str(job_id))
|
||||
|
||||
|
||||
async def enqueue_enrich(track_id: uuid.UUID) -> None:
|
||||
"""Best-effort enqueue of metadata enrichment for a freshly stored track.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user