fix(player): stop radio before starting track playback (#2039)

* fix(player): stop radio before starting track playback

When internet radio is streaming, clicking a track to play does nothing
because the MPV engine guards check currentStreamUrl and bail early.
Stop the radio stream before setting up the new queue on Play.NOW and
Play.SHUFFLE so the audio engine proceeds normally.

Fixes #2038

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: correct import ordering for lint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Braelyn Boynton
2026-05-18 17:58:08 -07:00
committed by GitHub
parent 5a3f2fe96f
commit f3c0b68a0f
+9
View File
@@ -7,6 +7,7 @@ import { useShallow } from 'zustand/react/shallow';
import { createWithEqualityFn } from 'zustand/traditional';
import { eventEmitter } from '/@/renderer/events/event-emitter';
import { useRadioStore as useRadioPlayerStore } from '/@/renderer/features/radio/hooks/use-radio-player';
import { createSelectors } from '/@/renderer/lib/zustand';
import { useSettingsStore } from '/@/renderer/store/settings.store';
import {
@@ -477,6 +478,10 @@ export const usePlayerStoreBase = createWithEqualityFn<PlayerState>()(
break;
}
case Play.NOW: {
if (useRadioPlayerStore.getState().currentStreamUrl) {
useRadioPlayerStore.getState().actions.stop();
}
set((state) => {
newItems.forEach((item) => {
state.queue.songs[item._uniqueId] = item;
@@ -531,6 +536,10 @@ export const usePlayerStoreBase = createWithEqualityFn<PlayerState>()(
break;
}
case Play.SHUFFLE: {
if (useRadioPlayerStore.getState().currentStreamUrl) {
useRadioPlayerStore.getState().actions.stop();
}
set((state) => {
newItems.forEach((item) => {
state.queue.songs[item._uniqueId] = item;