diff --git a/backend/konduktor/adapters/rekordbox/export.py b/backend/konduktor/adapters/rekordbox/export.py index f14aa3e..ece2b17 100644 --- a/backend/konduktor/adapters/rekordbox/export.py +++ b/backend/konduktor/adapters/rekordbox/export.py @@ -114,6 +114,8 @@ class RekordboxExporter: #: A COMPUTER library (master.db), which Rekordbox never reads from a stick — #: named so, beside "Rekordbox Export" (the stick's Device Library). display_name = "Rekordbox Library" + #: Rekordbox opens a master.db only from its own library folder. + computer_only = True library_filename = "master.db" drive_root = False diff --git a/backend/konduktor/core/model.py b/backend/konduktor/core/model.py index 977d416..bd64def 100644 --- a/backend/konduktor/core/model.py +++ b/backend/konduktor/core/model.py @@ -216,6 +216,9 @@ class PlatformOption(BaseModel): removable: bool = False #: As an export TARGET: its library is only found at a drive's root. drive_root: bool = False + #: As an export TARGET: its library is only ever read on a computer, never + #: from a drive — so it does nothing beside a stick format. + computer_only: bool = False class RemapSample(BaseModel): diff --git a/backend/konduktor/main.py b/backend/konduktor/main.py index f5637a2..a8c6192 100644 --- a/backend/konduktor/main.py +++ b/backend/konduktor/main.py @@ -633,6 +633,7 @@ def export_targets() -> list[PlatformOption]: found=0, removable=bool(getattr(d, "removable", False)), drive_root=bool(getattr(exporter, "drive_root", False)), + computer_only=bool(getattr(exporter, "computer_only", False)), )) # Targets with no reader of their own (the stick's legacy Device Library): # listed too, or registering one would not make it selectable. @@ -650,6 +651,7 @@ def export_targets() -> list[PlatformOption]: found=0, removable=bool(getattr(exporter, "drive_root", False)), drive_root=bool(getattr(exporter, "drive_root", False)), + computer_only=bool(getattr(exporter, "computer_only", False)), )) # Each exporter states its own place; a platform with no exporter (not yet a # target, shown disabled) goes last. Stable, so equal places keep their order. diff --git a/backend/test_device_export.py b/backend/test_device_export.py index 92d83b8..7ea92fc 100644 --- a/backend/test_device_export.py +++ b/backend/test_device_export.py @@ -223,6 +223,10 @@ from konduktor.main import app # noqa: E402 names = [o["name"] for o in TestClient(app).get("/api/export-targets").json()] check("OneLibrary, Traktor, Rekordbox Export, Rekordbox Library", names[:4] == ["OneLibrary", "Traktor", "Rekordbox Export", "Rekordbox Library"], names) +flags = {o["name"]: o for o in TestClient(app).get("/api/export-targets").json()} +check("Rekordbox Library says it is computer-only (the dialog warns beside a stick format)", + flags["Rekordbox Library"]["computer_only"] and not flags["Rekordbox Export"]["computer_only"] + and flags["Rekordbox Export"]["drive_root"]) print("\n" + ("❌ FAILED" if failed else "✅ PASSED")) raise SystemExit(1 if failed else 0) diff --git a/frontend/src/api.ts b/frontend/src/api.ts index ad54815..8dfd754 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -279,6 +279,8 @@ export interface PlatformOption { removable: boolean /** As an export target: its library is only found at a drive's ROOT. */ drive_root?: boolean + /** As an export target: only ever read on a computer, never from a drive. */ + computer_only?: boolean } export interface EditState { diff --git a/frontend/src/components/ExportDialog.tsx b/frontend/src/components/ExportDialog.tsx index 09f8f09..78b0518 100644 --- a/frontend/src/components/ExportDialog.tsx +++ b/frontend/src/components/ExportDialog.tsx @@ -57,6 +57,11 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) { const needsRoot = (targets.data ?? []).filter( (p) => p.drive_root && chosen.includes(p.platform), ) + // A computer-only library ticked beside a stick format: harmless, but it does + // nothing on the stick, which is easy to mistake for a broken export. + const computerOnly = (targets.data ?? []).filter( + (p) => p.computer_only && chosen.includes(p.platform), + ) const toggle = (platform: string, on: boolean) => setChosen((prev) => @@ -138,6 +143,13 @@ export function ExportDialog({ editing, onClose, onSaved, onError }: Props) { ))} + {computerOnly.length > 0 && needsRoot.length > 0 && ( +