fix: add FavQ and TopQ context types to playback context
The ContextType enum and v2_set_playback_context match were missing fav_q and top_q variants, causing an "Invalid context type" error that blocked all playback from FavQ and TopQ views. Also wrap setPlaybackContext calls in try/catch so context errors don't prevent track playback. Fixes #140
This commit is contained in:
4 files changed
+30
-16
No files matched your search
@@ -290,14 +290,18 @@
|
||||
|
||||
if (queueIndex < 0) return;
|
||||
|
||||
await setPlaybackContext(
|
||||
'fav_q',
|
||||
'favq',
|
||||
'FavQ',
|
||||
'qobuz',
|
||||
queueTrackIds,
|
||||
queueIndex
|
||||
);
|
||||
try {
|
||||
await setPlaybackContext(
|
||||
'fav_q',
|
||||
'favq',
|
||||
'FavQ',
|
||||
'qobuz',
|
||||
queueTrackIds,
|
||||
queueIndex
|
||||
);
|
||||
} catch (err) {
|
||||
console.error('Failed to set playback context:', err);
|
||||
}
|
||||
|
||||
try {
|
||||
await invoke('v2_set_queue', { tracks: queueTracks, startIndex: queueIndex });
|
||||
|
||||
@@ -403,14 +403,18 @@
|
||||
|
||||
if (queueIndex < 0) return;
|
||||
|
||||
await setPlaybackContext(
|
||||
'top_q',
|
||||
'topq',
|
||||
'TopQ',
|
||||
'qobuz',
|
||||
queueTrackIds,
|
||||
queueIndex
|
||||
);
|
||||
try {
|
||||
await setPlaybackContext(
|
||||
'top_q',
|
||||
'topq',
|
||||
'TopQ',
|
||||
'qobuz',
|
||||
queueTrackIds,
|
||||
queueIndex
|
||||
);
|
||||
} catch (err) {
|
||||
console.error('Failed to set playback context:', err);
|
||||
}
|
||||
|
||||
try {
|
||||
await invoke('v2_set_queue', { tracks: queueTracks, startIndex: queueIndex });
|
||||
|
||||
Reference in new issue
Block a user