update all command handlers for Option-wrapped per-user state

Modify callers in commands/, cast/, library/, and lib.rs to unwrap
Option<Store> with appropriate error messages. Fix drop(db) to
drop(guard__) for correct mutex release.
This commit is contained in:
vicrodh committed 2026-02-05 23:11:17 -06:00
1 parent aab3e67641
commit dbb5d998de
11 files changed
+365 -191

No files matched your search

+2 -1
View File
@@ -175,7 +175,8 @@ pub async fn cast_play_local_track(
library_state: State<'_, LibraryState>,
) -> Result<(), String> {
let track = {
let db = library_state.db.lock().await;
let db_opt__ = library_state.db.lock().await;
let db = db_opt__.as_ref().ok_or("No active session - please log in")?;
db.get_track(track_id)
.map_err(|e| e.to_string())?
.ok_or_else(|| "Track not found".to_string())?