debug: add quality logging to diagnose issue #34
- Log requested vs returned format_id and sample_rate in get_stream_url_with_fallback - Log quality_str, parsed quality, and format_id in play_track and prefetch_track commands - Add console.log in getStreamingQuality for frontend debugging This will help diagnose why 192kHz is played despite lower quality settings.
This commit is contained in:
1 parent
e1771db099
commit
f83eed1076
3 files changed
+20
-4
No files matched your search
@@ -629,7 +629,13 @@ impl QobuzClient {
|
||||
log::info!("Trying quality: {:?}", quality);
|
||||
match self.get_stream_url(track_id, *quality).await {
|
||||
Ok(url) if !url.has_restrictions() => {
|
||||
log::info!("Got stream URL successfully: {} (format: {})", url.url, url.mime_type);
|
||||
log::info!(
|
||||
"Got stream URL - requested format_id={}, got format_id={}, sample_rate={}Hz, bit_depth={:?}",
|
||||
quality.id(),
|
||||
url.format_id,
|
||||
url.sampling_rate,
|
||||
url.bit_depth
|
||||
);
|
||||
return Ok(url);
|
||||
},
|
||||
Ok(_) => {
|
||||
|
||||
@@ -35,7 +35,10 @@ pub async fn play_track(
|
||||
audio_settings: State<'_, AudioSettingsState>,
|
||||
) -> Result<(), String> {
|
||||
let preferred_quality = parse_quality(quality.as_deref());
|
||||
log::info!("Command: play_track {} (duration: {:?}s, quality: {:?})", track_id, duration_secs, preferred_quality);
|
||||
log::info!(
|
||||
"Command: play_track {} (duration: {:?}s, quality_str={:?}, parsed={:?}, format_id={})",
|
||||
track_id, duration_secs, quality, preferred_quality, preferred_quality.id()
|
||||
);
|
||||
|
||||
// First check offline cache (persistent disk cache)
|
||||
{
|
||||
@@ -222,7 +225,10 @@ pub async fn prefetch_track(
|
||||
offline_cache: State<'_, OfflineCacheState>,
|
||||
) -> Result<(), String> {
|
||||
let preferred_quality = parse_quality(quality.as_deref());
|
||||
log::info!("Command: prefetch_track {} (quality: {:?})", track_id, preferred_quality);
|
||||
log::info!(
|
||||
"Command: prefetch_track {} (quality_str={:?}, parsed={:?}, format_id={})",
|
||||
track_id, quality, preferred_quality, preferred_quality.id()
|
||||
);
|
||||
|
||||
let cache = state.audio_cache.clone();
|
||||
|
||||
|
||||
@@ -9,10 +9,14 @@ import { invoke } from '@tauri-apps/api/core';
|
||||
|
||||
/**
|
||||
* Get the preferred streaming quality from localStorage
|
||||
* Valid values: 'MP3', 'CD Quality', 'Hi-Res', 'Hi-Res+'
|
||||
*/
|
||||
function getStreamingQuality(): string {
|
||||
if (typeof localStorage === 'undefined') return 'Hi-Res+';
|
||||
return localStorage.getItem('qbz-streaming-quality') || 'Hi-Res+';
|
||||
const saved = localStorage.getItem('qbz-streaming-quality');
|
||||
// Log for debugging issue #34
|
||||
console.log('[Quality] getStreamingQuality called, localStorage value:', saved);
|
||||
return saved || 'Hi-Res+';
|
||||
}
|
||||
import { listen, type UnlistenFn } from '@tauri-apps/api/event';
|
||||
import {
|
||||
|
||||
Reference in new issue
Block a user