feat(qconnect): auto-skip remote track on PlaybackError

Consumer maps PlaybackError -> handleSkipForward for streamable/network/
not-found failures on the current queue item; toast otherwise. Predicate
shouldAutoSkipOnPlaybackError unit-tested. i18n keys added in 5 locales.

cc
This commit is contained in:
vicrodh committed 2026-06-01 03:28:15 -06:00
1 parent fea9dbe1d4
commit 151e4cbd2d
8 files changed
+85 -2

No files matched your search

+18 -1
View File
@@ -362,7 +362,9 @@
import {
replacePlaybackQueue,
assessQconnectQueueSync,
syncQconnectQueueFromTracks
syncQconnectQueueFromTracks,
shouldAutoSkipOnPlaybackError,
type QconnectPlaybackErrorPayload
} from '$lib/services/queuePlaybackService';
import type {
QconnectDiagnosticsPayload,
@@ -5774,6 +5776,21 @@
}
}
// Renderer reported a per-track playback failure. Auto-skip the
// failed track if it is the one currently playing and the error is a
// deterministic per-track failure; otherwise surface a toast.
if ('PlaybackError' in payloadObj) {
const pe = payloadObj.PlaybackError as QconnectPlaybackErrorPayload;
const currentQid =
qobuzConnectRendererSnapshot?.current_track?.queue_item_id ?? null;
if (shouldAutoSkipOnPlaybackError(pe, currentQid)) {
showToast($t('qconnect.trackUnavailableSkipping'), 'warning');
void handleSkipForward();
} else {
showToast($t('qconnect.trackPlaybackError'), 'error');
}
}
// Sync QBZ local queue when QConnect remote queue changes or
// renderer commands move the current track (next/prev from controllers).
const needsQueueSync =