refactor(plex): extract Plex integration into frontend-agnostic qbz-plex crate

Move the Plex LAN client, hand-rolled XML metadata parsing, and the
SQLite plex_cache.db logic out of src-tauri/src/plex/mod.rs into a new
qbz-plex core crate so it can be shared by every frontend (Tauri, Slint,
TUI) per ADR-006. Plex previously lived entirely in src-tauri (~1715
lines), which blocked the Slint Local Library port from shipping Plex.

The extraction is mechanical: the module was already almost entirely
plain Rust (reqwest + rusqlite + serde + hand-rolled XML). The only
Tauri coupling was a dead plex_play_track command bound to AppState
(unreferenced; the live path is commands_v2::v2_plex_play_track, which
calls plex_resolve_track_media + AppState.player itself). That dead fn
and the vestigial #[tauri::command] attributes are dropped.

src-tauri/src/plex/mod.rs becomes a `pub use qbz_plex::*;` re-export so
every existing crate::plex::* call site compiles unchanged. Full Tauri
workspace cargo check stays green; qbz-plex tests pass.

cc
This commit is contained in:
vicrodh committed 2026-05-28 15:20:23 -06:00
1 parent a2d8e43b1c
commit 2fe7008e23
7 files changed
+1727 -1714

No files matched your search

+1
View File
@@ -39,6 +39,7 @@ qbz-cast = { path = "../crates/qbz-cast" }
qbz-cmaf = { path = "../crates/qbz-cmaf" }
qbz-secrets = { path = "../crates/qbz-secrets" }
qbz-offline-cache = { path = "../crates/qbz-offline-cache" }
qbz-plex = { path = "../crates/qbz-plex" }
qconnect-app = { path = "../crates/qconnect-app" }
qconnect-core = { path = "../crates/qconnect-core" }
qconnect-transport-ws = { path = "../crates/qconnect-transport-ws" }