Fix Hi-Res quality badge showing as CD when playing from playlists
Root cause: Queue tracks were being built without quality fields (hires, bit_depth, sample_rate) in multiple views. When auto-advancing or skipping tracks, the playerStore would have undefined quality data, causing QualityBadge to default to CD tier. Fixed by: - Adding quality fields to queue track builders in PlaylistDetailView, FavoritesView, ArtistDetailView, and LocalLibraryView - Replacing all 'CD Quality' fallbacks with '-' placeholder in +page.svelte - Adding bitDepth/samplingRate fields to ArtistDetailView DisplayTrack
This commit is contained in:
1 parent
ed3cfe6b4f
commit
7affd2bf13
5 files changed
+42
-7
No files matched your search
@@ -49,6 +49,11 @@
|
||||
duration: string;
|
||||
durationSeconds: number;
|
||||
hires?: boolean;
|
||||
bitDepth?: number;
|
||||
samplingRate?: number;
|
||||
albumId?: string;
|
||||
artistId?: number;
|
||||
isrc?: string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
@@ -178,7 +183,12 @@
|
||||
albumArt: track.album?.image?.large || track.album?.image?.thumbnail || '',
|
||||
duration: formatDuration(track.duration),
|
||||
durationSeconds: track.duration,
|
||||
hires: track.hires_streamable
|
||||
hires: track.hires_streamable,
|
||||
bitDepth: track.maximum_bit_depth,
|
||||
samplingRate: track.maximum_sampling_rate,
|
||||
albumId: track.album?.id,
|
||||
artistId: track.performer?.id ?? artist.id,
|
||||
isrc: track.isrc,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -193,6 +203,9 @@
|
||||
album: t.album?.title || '',
|
||||
duration_secs: t.duration,
|
||||
artwork_url: t.album?.image?.large || t.album?.image?.thumbnail || '',
|
||||
hires: t.hires_streamable ?? false,
|
||||
bit_depth: t.maximum_bit_depth ?? null,
|
||||
sample_rate: t.maximum_sampling_rate ?? null,
|
||||
}));
|
||||
|
||||
try {
|
||||
|
||||
@@ -206,6 +206,9 @@
|
||||
album: t.album?.title || 'Favorites',
|
||||
duration_secs: t.duration,
|
||||
artwork_url: t.album?.image?.thumbnail || t.album?.image?.small || '',
|
||||
hires: t.hires ?? false,
|
||||
bit_depth: t.maximum_bit_depth ?? null,
|
||||
sample_rate: t.maximum_sampling_rate ?? null,
|
||||
}));
|
||||
|
||||
try {
|
||||
@@ -226,6 +229,9 @@
|
||||
album: t.album?.title || 'Favorites',
|
||||
duration_secs: t.duration,
|
||||
artwork_url: t.album?.image?.thumbnail || t.album?.image?.small || '',
|
||||
hires: t.hires ?? false,
|
||||
bit_depth: t.maximum_bit_depth ?? null,
|
||||
sample_rate: t.maximum_sampling_rate ?? null,
|
||||
}));
|
||||
|
||||
try {
|
||||
|
||||
@@ -353,7 +353,10 @@
|
||||
artist: t.artist,
|
||||
album: t.album,
|
||||
duration_secs: t.duration_secs,
|
||||
artwork_url: t.artwork_path ? `file://${t.artwork_path}` : null
|
||||
artwork_url: t.artwork_path ? `file://${t.artwork_path}` : null,
|
||||
hires: (t.bit_depth && t.bit_depth > 16) || t.sample_rate > 44100,
|
||||
bit_depth: t.bit_depth ?? null,
|
||||
sample_rate: t.sample_rate ?? null,
|
||||
}));
|
||||
|
||||
try {
|
||||
|
||||
@@ -391,6 +391,9 @@
|
||||
album: t.album || playlist?.name || 'Playlist',
|
||||
duration_secs: t.durationSeconds,
|
||||
artwork_url: t.albumArt || getPlaylistImage(),
|
||||
hires: t.hires ?? false,
|
||||
bit_depth: t.bitDepth ?? null,
|
||||
sample_rate: t.samplingRate ?? null,
|
||||
}));
|
||||
|
||||
try {
|
||||
@@ -427,6 +430,9 @@
|
||||
album: t.album || playlist?.name || 'Playlist',
|
||||
duration_secs: t.durationSeconds,
|
||||
artwork_url: t.albumArt || getPlaylistImage(),
|
||||
hires: t.hires ?? false,
|
||||
bit_depth: t.bitDepth ?? null,
|
||||
sample_rate: t.samplingRate ?? null,
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
@@ -444,6 +450,9 @@
|
||||
album: t.album || playlist?.name || 'Playlist',
|
||||
duration_secs: t.durationSeconds,
|
||||
artwork_url: t.albumArt || getPlaylistImage(),
|
||||
hires: t.hires ?? false,
|
||||
bit_depth: t.bitDepth ?? null,
|
||||
sample_rate: t.samplingRate ?? null,
|
||||
}));
|
||||
|
||||
try {
|
||||
|
||||
@@ -334,7 +334,9 @@
|
||||
const artwork = track.album?.image?.large || track.album?.image?.thumbnail || track.album?.image?.small || '';
|
||||
const quality = track.hires_streamable && track.maximum_bit_depth && track.maximum_sampling_rate
|
||||
? `${track.maximum_bit_depth}bit/${track.maximum_sampling_rate}kHz`
|
||||
: 'CD Quality';
|
||||
: track.hires_streamable
|
||||
? 'Hi-Res'
|
||||
: '-';
|
||||
|
||||
await playTrack({
|
||||
id: track.id,
|
||||
@@ -358,7 +360,9 @@
|
||||
const artwork = selectedAlbum?.artwork || '';
|
||||
const quality = track.hires && track.bitDepth && track.samplingRate
|
||||
? `${track.bitDepth}bit/${track.samplingRate}kHz`
|
||||
: 'CD Quality';
|
||||
: track.hires
|
||||
? 'Hi-Res'
|
||||
: '-';
|
||||
|
||||
// Build queue from album tracks before playing
|
||||
if (selectedAlbum?.tracks) {
|
||||
@@ -495,7 +499,7 @@
|
||||
? `${track.bit_depth}bit/${track.sample_rate}kHz`
|
||||
: track.hires
|
||||
? 'Hi-Res'
|
||||
: 'CD Quality';
|
||||
: '-';
|
||||
|
||||
// Play track using unified service
|
||||
await playTrack({
|
||||
@@ -673,7 +677,7 @@
|
||||
album: selectedAlbum?.title,
|
||||
albumId: selectedAlbum?.id,
|
||||
durationSecs: track.durationSeconds,
|
||||
quality: track.quality || 'CD Quality',
|
||||
quality: track.quality || '-',
|
||||
bitDepth: track.bitDepth,
|
||||
sampleRate: track.samplingRate,
|
||||
});
|
||||
@@ -718,7 +722,7 @@
|
||||
album: selectedAlbum.title,
|
||||
albumId: selectedAlbum.id,
|
||||
durationSecs: track.durationSeconds,
|
||||
quality: track.quality || 'CD Quality',
|
||||
quality: track.quality || '-',
|
||||
bitDepth: track.bitDepth,
|
||||
sampleRate: track.samplingRate,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user