perf(api): replace Mutex with RwLock for QobuzClient

QobuzClient has no &mut self methods — all API calls are read-only.
The Mutex serialized all concurrent API requests (favorites sync,
sidebar playlists, playlist loading) causing 6+ second wait times
at startup.

RwLock allows concurrent reads. All 94 call sites across 20 files
changed from .lock() to .read(). ListenBrainz/LastFm clients keep
their own Mutex (different state, different lock).
This commit is contained in:
vicrodh committed 2026-02-09 22:50:35 -06:00
1 parent 8f1cc735a7
commit 8270de2e5e
20 files changed
+100 -100

No files matched your search

+1 -1
View File
@@ -125,7 +125,7 @@ pub async fn cast_play_track(
app_state: State<'_, AppState>,
) -> Result<(), String> {
let stream_url = {
let client = app_state.client.lock().await;
let client = app_state.client.read().await;
client
.get_stream_url_with_fallback(track_id, Quality::HiRes)
.await
+1 -1
View File
@@ -123,7 +123,7 @@ pub async fn dlna_play_track(
// Get stream URL from Qobuz
let stream_url = {
let client = app_state.client.lock().await;
let client = app_state.client.read().await;
client
.get_stream_url_with_fallback(track_id, Quality::HiRes)
.await