lore(changelog): auth changes

Updating docs for tag release.
This commit is contained in:
vicrodh authored and vicrodh committed 2026-04-05 09:39:51 -06:00
1 parent 223dbf553e
commit d474a55d70
2 files changed
+167 -96

No files matched your search

+9 -1
View File
@@ -4,6 +4,8 @@ About a month and a half ago, Qobuz began making changes to their authentication
We are considering requesting official API access again, and looking for ways to coordinate with the community to support this request to Qobuz — so that a more severe change in the future does not leave us out.
Version 1.2.2 was supposed to take a little longer to arrive, with initial support for BSD and headless mode, but this authentication issue has forced us to bring it forward; there aren't really many new features this time.
Thank you all for the continued support for QBZ.
---
@@ -11,6 +13,8 @@ Thank you all for the continued support for QBZ.
## Authentication
- **OAuth-only login** — username/password authentication has been removed; OAuth via browser is now the sole login method
- **System browser login** — new option to authenticate via your default browser (Firefox, Chrome, etc.) instead of the embedded WebView; supports password managers and saved sessions
- **Bootstrap no longer attempts basic auth** — users with old saved credentials now see the login screen instead of hitting Qobuz's deprecated endpoint
- **Token login migrated to V2 crates** — OAuth token handling moved to the V2 core architecture
## Bug Fixes
@@ -20,6 +24,8 @@ Thank you all for the continued support for QBZ.
- **Incorrect artist location in Artist Network** — birth/formation location display fixed for MusicBrainz area hierarchy (#235)
- **Bulk "make available offline" not downloading** — the action now actually triggers track downloads (#231)
- **F11 fullscreen and ESC exit** — both now work globally across all views (#202)
- **Cached tracks playing at wrong quality** — cache now validates sample rate and bit depth against the requested quality; stale fallback-quality files are re-downloaded transparently (#270)
- **JACK/qjackctl routing broken between tracks** — new "Lock Output Device" option prevents QBZ from changing the system default sink on stream recreation (#263)
- **Scroll position lost on navigation** — scroll state is now saved even without explicit scrolling
- **Virtualized container scroll restoration** — fixed for all virtualized list and grid components
@@ -30,6 +36,7 @@ Thank you all for the continued support for QBZ.
- **Sleep inhibition** — system sleep is now prevented during active playback via XDG portal (#229)
- **Log sanitization** — sensitive IDs and UUIDs are now stripped from logs before upload (#213)
- **Streaming buffer indicator** — progress bar in the seekbar shows how much of the track has been buffered (#194)
- **Lock Output Device** — opt-in PipeWire setting for JACK/DAW users; skips pactl set-default-sink to preserve external routing (#263)
## macOS Improvements
@@ -53,10 +60,11 @@ Thank you all for the continued support for QBZ.
- **Log upload migrated to paste.rs** — dpaste.org now returns 403/405
- **Gentoo overlay** — use libayatana-appindicator instead of libappindicator (#262)
- **Security** — esbuild upgraded to 0.25.x (CVE in <= 0.24.2); CodeQL cleartext-logging alerts resolved
- **Dependency updates** — vite 8, lofty 0.23, axum 0.8, rand 0.10, souvlaki 0.8.3, lucide-svelte 1.0
---
Thanks to [@afonsojramos](https://github.com/afonsojramos), [@GwendalBeaumont](https://github.com/GwendalBeaumont), and [@AdamArstall](https://github.com/AdamArstall) for their contributions to this release.
Thanks to @afonsojramos, @GwendalBeaumont, and @AdamArstall for their contributions to this release.
Full changelog: https://github.com/vicrodh/qbz/compare/v1.2.1...v1.2.2
+158 -95
View File
@@ -288,22 +288,50 @@ fn limit_quality_for_device(quality: Quality, max_sample_rate: Option<u32>) -> Q
}
}
/// Probe sample rate from FLAC audio data by reading the STREAMINFO header.
/// Returns None for non-FLAC data or data too short to parse.
#[cfg(target_os = "linux")]
fn probe_flac_sample_rate(data: &[u8]) -> Option<u32> {
// FLAC format: "fLaC" magic + metadata blocks
// First block is always STREAMINFO (34 bytes)
// Bytes 18-20 of STREAMINFO contain: sample_rate (20 bits) | channels (3 bits) | bps (5 bits) | ...
/// Probe sample rate and bit depth from FLAC STREAMINFO header.
/// Returns (sample_rate, bit_depth) or None for non-FLAC / truncated data.
fn probe_flac_format(data: &[u8]) -> Option<(u32, u32)> {
// FLAC: "fLaC" magic + metadata blocks. First block = STREAMINFO (34 bytes).
// Byte layout at offset 18: sample_rate (20 bits) | channels (3 bits) | bps (5 bits) | ...
if data.len() < 22 || &data[0..4] != b"fLaC" {
return None;
}
let sr = ((data[18] as u32) << 12) | ((data[19] as u32) << 4) | ((data[20] as u32) >> 4);
if sr > 0 {
Some(sr)
} else {
None
let bps = ((data[20] as u32) & 0x01) << 4 | ((data[21] as u32) >> 4);
let bit_depth = bps + 1; // FLAC stores bps-1
if sr > 0 { Some((sr, bit_depth)) } else { None }
}
/// Convenience wrapper used by ALSA hardware check (Linux only).
#[cfg(target_os = "linux")]
fn probe_flac_sample_rate(data: &[u8]) -> Option<u32> {
probe_flac_format(data).map(|(sr, _)| sr)
}
/// Check if cached audio quality is below what the user requested.
/// Returns true if the cache should be skipped in favor of a fresh download.
fn cached_quality_below_requested(data: &[u8], requested: Quality) -> bool {
let (sample_rate, bit_depth) = match probe_flac_format(data) {
Some(fmt) => fmt,
None => return false, // Can't parse — assume compatible
};
let dominated = match requested {
// Hi-Res+: expect 24-bit AND >96kHz
Quality::UltraHiRes => bit_depth < 24 || sample_rate <= 96000,
// Hi-Res: expect 24-bit
Quality::HiRes => bit_depth < 24,
// Lossless / Mp3: any FLAC is fine
_ => false,
};
if dominated {
log::info!(
"[V2/Quality] Cached audio is {}Hz/{}bit but requested {:?} — will try re-download",
sample_rate, bit_depth, requested
);
}
dominated
}
/// Check if cached audio data has a sample rate that the current ALSA hardware
@@ -7686,6 +7714,10 @@ pub async fn v2_play_track(
let bridge_guard = bridge.get().await;
let player = bridge_guard.player();
// Fallback: if cache has lower quality than requested but network fails,
// play the cached version rather than failing entirely.
let mut low_quality_fallback: Option<Vec<u8>> = None;
// Check offline cache (persistent disk cache)
{
let cached_path = {
@@ -7713,38 +7745,29 @@ pub async fn v2_play_track(
RuntimeError::Internal(format!("Failed to read cached file: {}", e))
})?;
// Check if cached audio is compatible with hardware
// Check hardware compatibility (ALSA only)
#[cfg(target_os = "linux")]
if cached_audio_incompatible_with_hw(&audio_data, &audio_settings) {
let hw_incompatible =
cached_audio_incompatible_with_hw(&audio_data, &audio_settings);
#[cfg(not(target_os = "linux"))]
let hw_incompatible = false;
// Check quality mismatch (all platforms)
let quality_mismatch = cached_quality_below_requested(&audio_data, final_quality);
if hw_incompatible {
log::info!(
"[V2/Quality] Skipping OFFLINE cache for track {} - incompatible sample rate",
track_id
);
// Fall through to network path which will request compatible quality
} else if quality_mismatch {
// Keep as fallback — don't discard, network might fail
low_quality_fallback = Some(audio_data);
} else {
player
.play_data(audio_data, track_id)
.map_err(RuntimeError::Internal)?;
// Prefetch next tracks in background (using CoreBridge queue)
let upcoming_tracks = bridge_guard.peek_upcoming(V2_PREFETCH_LOOKAHEAD).await;
drop(bridge_guard);
spawn_v2_prefetch(
bridge.0.clone(),
app_state.audio_cache.clone(),
upcoming_tracks,
final_quality,
streaming_only,
);
return Ok(V2PlayTrackResult { format_id: None });
}
#[cfg(not(target_os = "linux"))]
{
player
.play_data(audio_data, track_id)
.map_err(RuntimeError::Internal)?;
let upcoming_tracks = bridge_guard.peek_upcoming(V2_PREFETCH_LOOKAHEAD).await;
drop(bridge_guard);
spawn_v2_prefetch(
@@ -7760,75 +7783,35 @@ pub async fn v2_play_track(
}
}
// Check memory cache (L1) - using AppState's audio_cache for now
// TODO: Move cache to qbz-core in future refactor
// Check memory cache (L1)
let cache = app_state.audio_cache.clone();
if let Some(cached) = cache.get(track_id) {
log::info!(
"[V2/CACHE HIT] Track {} from MEMORY cache ({} bytes)",
track_id,
cached.size_bytes
);
// Check if cached audio is compatible with hardware
#[cfg(target_os = "linux")]
let skip_cache = cached_audio_incompatible_with_hw(&cached.data, &audio_settings);
#[cfg(not(target_os = "linux"))]
let skip_cache = false;
if skip_cache {
if low_quality_fallback.is_none() {
if let Some(cached) = cache.get(track_id) {
log::info!(
"[V2/Quality] Skipping MEMORY cache for track {} - incompatible sample rate",
track_id
);
// Fall through to network path which will request compatible quality
} else {
player
.play_data(cached.data, track_id)
.map_err(RuntimeError::Internal)?;
// Prefetch next tracks in background (using CoreBridge queue)
let upcoming_tracks = bridge_guard.peek_upcoming(V2_PREFETCH_LOOKAHEAD).await;
drop(bridge_guard);
spawn_v2_prefetch(
bridge.0.clone(),
cache.clone(),
upcoming_tracks,
final_quality,
streaming_only,
);
return Ok(V2PlayTrackResult { format_id: None });
}
}
// Check playback cache (L2 - disk)
if let Some(playback_cache) = cache.get_playback_cache() {
if let Some(audio_data) = playback_cache.get(track_id) {
log::info!(
"[V2/CACHE HIT] Track {} from DISK cache ({} bytes)",
"[V2/CACHE HIT] Track {} from MEMORY cache ({} bytes)",
track_id,
audio_data.len()
cached.size_bytes
);
// Check if cached audio is compatible with hardware
#[cfg(target_os = "linux")]
let skip_cache = cached_audio_incompatible_with_hw(&audio_data, &audio_settings);
let hw_incompatible = cached_audio_incompatible_with_hw(&cached.data, &audio_settings);
#[cfg(not(target_os = "linux"))]
let skip_cache = false;
let hw_incompatible = false;
if skip_cache {
let quality_mismatch = cached_quality_below_requested(&cached.data, final_quality);
if hw_incompatible {
log::info!(
"[V2/Quality] Skipping DISK cache for track {} - incompatible sample rate",
"[V2/Quality] Skipping MEMORY cache for track {} - incompatible sample rate",
track_id
);
// Fall through to network path which will request compatible quality
} else if quality_mismatch {
low_quality_fallback = Some(cached.data);
} else {
cache.insert(track_id, audio_data.clone());
player
.play_data(audio_data, track_id)
.play_data(cached.data, track_id)
.map_err(RuntimeError::Internal)?;
// Prefetch next tracks in background (using CoreBridge queue)
let upcoming_tracks = bridge_guard.peek_upcoming(V2_PREFETCH_LOOKAHEAD).await;
drop(bridge_guard);
spawn_v2_prefetch(
@@ -7843,16 +7826,96 @@ pub async fn v2_play_track(
}
}
// Not in any cache - get stream URL from Qobuz via CoreBridge
log::info!(
"[V2] Track {} not in cache, fetching from network...",
track_id
);
// Check playback cache (L2 - disk)
if low_quality_fallback.is_none() {
if let Some(playback_cache) = cache.get_playback_cache() {
if let Some(audio_data) = playback_cache.get(track_id) {
log::info!(
"[V2/CACHE HIT] Track {} from DISK cache ({} bytes)",
track_id,
audio_data.len()
);
let mut stream_url = bridge_guard
#[cfg(target_os = "linux")]
let hw_incompatible =
cached_audio_incompatible_with_hw(&audio_data, &audio_settings);
#[cfg(not(target_os = "linux"))]
let hw_incompatible = false;
let quality_mismatch =
cached_quality_below_requested(&audio_data, final_quality);
if hw_incompatible {
log::info!(
"[V2/Quality] Skipping DISK cache for track {} - incompatible sample rate",
track_id
);
} else if quality_mismatch {
low_quality_fallback = Some(audio_data);
} else {
cache.insert(track_id, audio_data.clone());
player
.play_data(audio_data, track_id)
.map_err(RuntimeError::Internal)?;
let upcoming_tracks = bridge_guard.peek_upcoming(V2_PREFETCH_LOOKAHEAD).await;
drop(bridge_guard);
spawn_v2_prefetch(
bridge.0.clone(),
cache.clone(),
upcoming_tracks,
final_quality,
streaming_only,
);
return Ok(V2PlayTrackResult { format_id: None });
}
}
}
}
// Not in cache (or cached at lower quality) — fetch from network
if low_quality_fallback.is_some() {
log::info!(
"[V2] Track {} cached at lower quality, re-downloading at {:?}...",
track_id, final_quality
);
} else {
log::info!(
"[V2] Track {} not in cache, fetching from network...",
track_id
);
}
let stream_url_result = bridge_guard
.get_stream_url(track_id, final_quality)
.await
.map_err(RuntimeError::Internal)?;
.await;
let mut stream_url = match stream_url_result {
Ok(url) => url,
Err(e) => {
// Network failed — use lower-quality fallback if available
if let Some(fallback_data) = low_quality_fallback {
log::warn!(
"[V2] Network failed for track {}: {}. Playing cached lower-quality version.",
track_id, e
);
player
.play_data(fallback_data, track_id)
.map_err(RuntimeError::Internal)?;
let upcoming_tracks = bridge_guard.peek_upcoming(V2_PREFETCH_LOOKAHEAD).await;
drop(bridge_guard);
spawn_v2_prefetch(
bridge.0.clone(),
cache.clone(),
upcoming_tracks,
final_quality,
streaming_only,
);
return Ok(V2PlayTrackResult { format_id: None });
}
return Err(RuntimeError::Internal(e));
}
};
log::info!(
"[V2] Got stream URL for track {} (format_id={})",
track_id,