mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-10 06:12:43 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user