Merge pull request #501 from kgarner7/allow-no-mpv

- OOBE default to web player
- Allow mpv to run using PATH env
- Add improved mpv error logging
- Add web player fallback on mpv error
This commit is contained in:
Jeff 2024-02-13 16:16:01 -08:00 committed by GitHub
commit eab11658bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 706 additions and 418 deletions

View file

@ -1,7 +1,7 @@
import { useCallback, useRef } from 'react';
import { useQueryClient } from '@tanstack/react-query';
import { useCurrentServer, usePlayerControls, usePlayerStore } from '/@/renderer/store';
import { usePlayerType } from '/@/renderer/store/settings.store';
import { usePlaybackType } from '/@/renderer/store/settings.store';
import {
PlayQueueAddOptions,
Play,
@ -65,7 +65,7 @@ const addToQueue = usePlayerStore.getState().actions.addToQueue;
export const useHandlePlayQueueAdd = () => {
const { t } = useTranslation();
const queryClient = useQueryClient();
const playerType = usePlayerType();
const playbackType = usePlaybackType();
const server = useCurrentServer();
const { play } = usePlayerControls();
const timeoutIds = useRef<Record<string, ReturnType<typeof setTimeout>> | null>({});
@ -170,7 +170,7 @@ export const useHandlePlayQueueAdd = () => {
const hadSong = usePlayerStore.getState().queue.default.length > 0;
const playerData = addToQueue({ initialIndex: initialSongIndex, playType, songs });
if (playerType === PlaybackType.LOCAL) {
if (playbackType === PlaybackType.LOCAL) {
mpvPlayer!.volume(usePlayerStore.getState().volume);
if (playType === Play.NOW || !hadSong) {
@ -198,7 +198,7 @@ export const useHandlePlayQueueAdd = () => {
return null;
},
[play, playerType, queryClient, server, t],
[play, playbackType, queryClient, server, t],
);
return handlePlayQueueAdd;