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:
vicrodh committed 2026-01-11 19:57:40 -06:00
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 {