fix(playback): persist streaming quality setting
Quality was hardcoded to UltraHiRes in backend. Now: - Frontend passes quality from localStorage to play_track command - Backend parses quality string to Quality enum - All prefetch and stream URL calls use the user's preferred quality
This commit is contained in:
1 parent
700dc07014
commit
a6fc264903
3 files changed
+54
-8
No files matched your search
@@ -10,6 +10,15 @@
|
||||
*/
|
||||
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
|
||||
/**
|
||||
* Get the preferred streaming quality from localStorage
|
||||
* Returns: 'MP3', 'CD Quality', 'Hi-Res', or 'Hi-Res+' (default)
|
||||
*/
|
||||
function getStreamingQuality(): string {
|
||||
if (typeof localStorage === 'undefined') return 'Hi-Res+';
|
||||
return localStorage.getItem('qbz-streaming-quality') || 'Hi-Res+';
|
||||
}
|
||||
import {
|
||||
setCurrentTrack,
|
||||
setIsPlaying,
|
||||
@@ -114,7 +123,11 @@ export async function playTrack(
|
||||
if (isLocal) {
|
||||
await invoke('library_play_track', { trackId: track.id });
|
||||
} else {
|
||||
await invoke('play_track', { trackId: track.id, durationSecs: track.duration });
|
||||
await invoke('play_track', {
|
||||
trackId: track.id,
|
||||
durationSecs: track.duration,
|
||||
quality: getStreamingQuality()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user