temporarily remove old player implementations to prevent broken app

This commit is contained in:
jeffvli
2025-11-02 01:40:20 -08:00
parent 4e3a3742a5
commit 9abda23a4a
42 changed files with 2571 additions and 2598 deletions
+20 -27
View File
@@ -1,22 +1,16 @@
import { HotkeyItem, useHotkeys } from '@mantine/hooks';
import clsx from 'clsx';
import isElectron from 'is-electron';
import { lazy, useMemo } from 'react';
import { lazy } from 'react';
import { useNavigate } from 'react-router';
import styles from './default-layout.module.css';
import { ContextMenuProvider } from '/@/renderer/features/context-menu/context-menu-provider';
import { CommandPalette } from '/@/renderer/features/search/components/command-palette';
import { MainContent } from '/@/renderer/layouts/default-layout/main-content';
import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
import { AppRoute } from '/@/renderer/router/routes';
import {
useAppStore,
useCommandPalette,
useCurrentStatus,
useQueueStatus,
} from '/@/renderer/store';
import { useAppStore, useCommandPalette } from '/@/renderer/store';
import {
useGeneralSettings,
useHotkeySettings,
@@ -24,13 +18,13 @@ import {
useSettingsStoreActions,
useWindowSettings,
} from '/@/renderer/store/settings.store';
import { Platform, PlaybackType, PlayerStatus } from '/@/shared/types/types';
import { Platform, PlayerType } from '/@/shared/types/types';
if (!isElectron()) {
useSettingsStore.getState().actions.setSettings({
playback: {
...useSettingsStore.getState().playback,
type: PlaybackType.WEB,
type: PlayerType.WEB,
},
});
}
@@ -53,8 +47,7 @@ export const DefaultLayout = ({ shell }: DefaultLayoutProps) => {
const localSettings = isElectron() ? window.api.localSettings : null;
const settings = useGeneralSettings();
const { setSettings } = useSettingsStoreActions();
const playerStatus = useCurrentStatus();
const { currentSong, index, length } = useQueueStatus();
const { privateMode } = useAppStore();
const updateZoom = (increase: number) => {
@@ -83,21 +76,21 @@ export const DefaultLayout = ({ shell }: DefaultLayoutProps) => {
...(isElectron() ? zoomHotkeys : []),
]);
const title = useMemo(() => {
const statusString = playerStatus === PlayerStatus.PAUSED ? '(Paused) ' : '';
const queueString = length ? `(${index + 1} / ${length}) ` : '';
const privateModeString = privateMode ? '(Private mode)' : '';
const title = `${
length
? `${statusString}${queueString}${currentSong?.name}${currentSong?.artistName ? `${currentSong?.artistName} — Feishin` : ''}`
: 'Feishin'
}${privateMode ? ` ${privateModeString}` : ''}`;
document.title = title;
return title;
}, [currentSong?.artistName, currentSong?.name, index, length, playerStatus, privateMode]);
// const title = useMemo(() => {
// const statusString = playerStatus === PlayerStatus.PAUSED ? '(Paused) ' : '';
// const queueString = length ? `(${index + 1} / ${length}) ` : '';
// const privateModeString = privateMode ? '(Private mode)' : '';
// const title = `${
// length
// ? `${statusString}${queueString}${currentSong?.name}${currentSong?.artistName ? ` — ${currentSong?.artistName} — Feishin` : ''}`
// : 'Feishin'
// }${privateMode ? ` ${privateModeString}` : ''}`;
// document.title = title;
// return title;
// }, [currentSong?.artistName, currentSong?.name, index, length, playerStatus, privateMode]);
return (
<ContextMenuProvider>
<>
<div
className={clsx(styles.layout, {
[styles.macos]: windowBarStyle === Platform.MACOS,
@@ -105,11 +98,11 @@ export const DefaultLayout = ({ shell }: DefaultLayoutProps) => {
})}
id="default-layout"
>
{windowBarStyle !== Platform.WEB && <WindowBar title={title} />}
{windowBarStyle !== Platform.WEB && <WindowBar title="" />}
<MainContent shell={shell} />
<PlayerBar />
</div>
<CommandPalette modalProps={{ handlers, opened }} />
</ContextMenuProvider>
</>
);
};