An "Export" button on the watchlist filter bar opens a modal (same aesthetic as the artist DB-record inspector) to export your whole watchlist roster — each artist's name + source IDs (spotify / musicbrainz / deezer / discogs / itunes / amazon), with an optional "external links" toggle that adds the discography URLs built from those IDs. Live preview, copy, and download in the chosen format. - core/exports/watchlist_export.py: pure builder (json/csv/txt + links, present-IDs only, deterministic columns) — the single source of truth, fully unit-tested. - GET /api/watchlist/export?format=&links= shapes the roster + returns it (with X-Export-Count / X-Export-Ext headers for the modal). - Frontend reuses the DB-record helpers (_jsonSyntaxHighlight / _arecCopy). Tests (8): builder across json/csv/txt, links on/off, present-ids-only, empty + bad-format fallback, mime/ext, and endpoint wiring. ruff clean; 64 integrity green. Scoped to the watchlist for v1; library-wide export + a "library contents" (owned albums/tracks) option are natural follow-ups.
1 line
28 B
Python
1 line
28 B
Python
"""Data export builders."""
|