Stage 2. The measured win: opening a 34-item collection now costs **2** library.db opens instead of 23-34 — the local source owns a pooled handle and hands out no guard, only `with(|db| ...)`, so a `!Send` `&LibraryDatabase` cannot cross an await either. Bug 1 from the seam design is dead by construction, not by care. The owner's rules, decided today, now live in one place instead of eight: - **Collection** takes albums, singles and EPs from ANY source — qobuz, folders, Plex, and whatever is added next. **Mixtape** takes albums, playlists and tracks. This was a single boolean (`restrict_to_mixtape`) that could express neither release types nor "collections accept local". - An unsupported combination must never be VISIBLE: the picker stops offering the impossible action, and the error stays a log-only safety net. Owner: "el bloqueo no debería ser visible nunca, más bien esto hay que ajustarlo en la UI". - **Ephemeral honours its name** — playable, queueable, and offerable to nothing else. - A row's source comes from the ROW. Eight QML sites built the add-to-mixtape payload with `"source": "qobuz"` written as a literal, so a Plex or local track was stored as Qobuz and afterwards could not play at all: the app asked the Qobuz API for an id that never existed there. `QobuzSource` reads the client through a lens on every call instead of holding a clone. That is not style: `qbz-core` REPLACES its client (core.rs:346 and :384, both on paths that run before `set_session`), so a cached clone goes stale and fails silently — the hazard the crate's own doc comment described. The lens is installed in `on_boot`, first of everything, and finding out why is the lesson of this commit. The gate was green — build, 142 tests, both QML audits, a clean offscreen smoke — and the feature was visibly broken: every Qobuz row showed "No results found", an empty Quality cell and a wrong "SINGLE" type, while the Plex rows resolved fine. The registry is a OnceLock, so whoever touches it first BUILDS it, and one built without the lens leaves Qobuz permanently detached. Only driving the real app surfaced it; the crate's error string named the cause exactly, which is the one thing that made it a ten-minute fix instead of an afternoon. cc
73 lines
2.8 KiB
TOML
73 lines
2.8 KiB
TOML
[package]
|
|
name = "qbz-qt"
|
|
description = "Qt/QML frontend POC for QBZ (cxx-qt bridge over the UI-agnostic backend)"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
|
|
[[bin]]
|
|
name = "qbz-qt"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
cxx = "1"
|
|
cxx-qt = "0.7"
|
|
cxx-qt-lib = { version = "0.7", features = ["qt_full"] }
|
|
|
|
tokio = { workspace = true }
|
|
log = { workspace = true }
|
|
rand = { workspace = true }
|
|
serde = { workspace = true, features = ["derive"] }
|
|
serde_json = { workspace = true }
|
|
reqwest = { workspace = true }
|
|
urlencoding = "2"
|
|
open = "5"
|
|
dirs = "5"
|
|
|
|
qbz-core = { path = "../qbz-core" }
|
|
qbz-app = { path = "../qbz-app" }
|
|
qbz-audio = { path = "../qbz-audio" }
|
|
qbz-qobuz = { path = "../qbz-qobuz" }
|
|
qbz-models = { path = "../qbz-models" }
|
|
qbz-cache = { path = "../qbz-cache" }
|
|
qbz-offline-cache = { path = "../qbz-offline-cache" }
|
|
qbz-library = { path = "../qbz-library" }
|
|
# MyQBZ: Mixtapes & Collections backend (schema + migrations, repo, shuffle,
|
|
# enqueue). Headless and frontend-agnostic (ADR-006) — the same crate the
|
|
# Slint app uses (crates/qbz/Cargo.toml:96), so the two frontends share
|
|
# library.db's mixtape tables rather than each growing their own.
|
|
qbz-mixtape = { path = "../qbz-mixtape" }
|
|
qbz-source = { path = "../qbz-source" }
|
|
# Cast: Chromecast + DLNA discovery, the two device families and the local
|
|
# media server (src/cast_qt.rs drives it — nothing is reimplemented).
|
|
qbz-cast = { path = "../qbz-cast" }
|
|
qbz-plex = { path = "../qbz-plex" }
|
|
qbz-lyrics = { path = "../qbz-lyrics" }
|
|
qbz-text-utils = { path = "../qbz-text-utils" }
|
|
qbz-credentials = { path = "../qbz-credentials" }
|
|
qbz-i18n = { path = "../qbz-i18n" }
|
|
qbz-log = { path = "../qbz-log" }
|
|
qbz-theme = { path = "../qbz-theme" }
|
|
qbz-integrations = { path = "../qbz-integrations" }
|
|
# Last.fm "similar albums" row on the album page (external_reco_qt.rs).
|
|
qbz-external-reco = { path = "../qbz-external-reco" }
|
|
async-trait = "0.1"
|
|
|
|
rusqlite = { version = "0.31", features = ["bundled"] }
|
|
image = { version = "0.25", default-features = false, features = ["jpeg", "png"] }
|
|
|
|
# Native file picker, used by exactly two call sites — the MyQBZ collection
|
|
# cover upload (src/myqbz_cover_qt.rs) and the My-QBZ branding icon picker
|
|
# (src/myqbz_prefs_qt.rs).
|
|
#
|
|
# The feature set is NOT negotiable and is copied verbatim from the reference
|
|
# (crates/qbz/Cargo.toml:72): "async-std" is rfd's name for the
|
|
# async-io/ashpd backend. NEVER enable rfd's "tokio" feature — zbus 5's
|
|
# tokio feature unifies graph-wide and breaks the accesskit/atspi/ksni
|
|
# threads. `default-features = false` keeps the GTK3 backend out; the
|
|
# xdg-portal path is the Wayland-correct one and needs no extra system libs.
|
|
rfd = { version = "0.15", default-features = false, features = ["xdg-portal", "async-std"] }
|
|
|
|
[build-dependencies]
|
|
cxx-qt-build = "0.7"
|