Skip to content

Commit

Permalink
fix issues after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
iiPythonx committed Sep 2, 2024
1 parent 76e13d9 commit e8e3e68
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 117 deletions.
6 changes: 0 additions & 6 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,6 @@
"applicationHotkeys_description": "configure application hotkeys. toggle the checkbox to set as a global hotkey (desktop only)",
"artistConfiguration": "album artist page configuration",
"artistConfiguration_description": "configure what items are shown, and in what order, on the album artist page",
"artistBiographies": "enable artist biographies",
"artistBiographies_description": "determines whether feishin will display artist biographies from navidrome",
"artistTopSongs": "enable artist top songs",
"artistTopSongs_description": "determines whether feishin will display the top songs of an artist",
"audioDevice": "audio device",
"audioDevice_description": "select the audio device to use for playback (web player only)",
"audioExclusiveMode": "audio exclusive mode",
Expand Down Expand Up @@ -676,8 +672,6 @@
"volumeWheelStep_description": "the amount of volume to change when scrolling the mouse wheel on the volume slider",
"volumeWidth": "volume slider width",
"volumeWidth_description": "the width of the volume slider",
"webAudio": "use web audio",
"webAudio_description": "use web audio. this enables advanced features like replaygain. disable if you experience otherwise",
"windowBarStyle": "window bar style",
"windowBarStyle_description": "select the style of the window bar",
"zoom": "zoom percentage",
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/audio-player/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { PlaybackStyle, PlayerStatus } from '/@/renderer/types';
import { getServerById, TranscodingConfig, usePlaybackSettings, useSpeed } from '/@/renderer/store';
import { toast } from '/@/renderer/components/toast';
import { api } from '/@/renderer/api';
import { useWebAudio } from '/@/renderer/features/player/hooks/use-webaudio';

interface AudioPlayerProps extends ReactPlayerProps {
crossfadeDuration: number;
Expand Down Expand Up @@ -111,7 +112,6 @@ export const AudioPlayer = forwardRef(
const [isTransitioning, setIsTransitioning] = useState(false);
const audioDeviceId = useSettingsStore((state) => state.playback.audioDeviceId);
const playback = useSettingsStore((state) => state.playback.mpvProperties);
const useWebAudio = useSettingsStore((state) => state.playback.webAudio);
const { resetSampleRate } = useSettingsStoreActions();
const playbackSpeed = useSpeed();
const { transcode } = usePlaybackSettings();
Expand Down Expand Up @@ -176,7 +176,7 @@ export const AudioPlayer = forwardRef(
);

useEffect(() => {
if (useWebAudio && 'AudioContext' in window) {
if ('AudioContext' in window) {
let context: AudioContext;

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ interface AlbumDetailHeaderProps {
background: string;
blur: number;
};
background: {
background: string;
blur: number;
};
}

export const AlbumDetailHeader = forwardRef(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ import { LibraryBackgroundOverlay } from '/@/renderer/features/shared/components
import { useContainerQuery } from '/@/renderer/hooks';
import { AppRoute } from '/@/renderer/router/routes';
import { ArtistItem, useCurrentServer } from '/@/renderer/store';
import {
useArtistSettings,
useGeneralSettings,
usePlayButtonBehavior,
} from '/@/renderer/store/settings.store';
import { useGeneralSettings, usePlayButtonBehavior } from '/@/renderer/store/settings.store';
import { CardRow, Play, TableColumn } from '/@/renderer/types';
import { sanitize } from '/@/renderer/utils/sanitize';
import { useGenreRoute } from '/@/renderer/hooks/use-genre-route';
Expand Down Expand Up @@ -69,7 +65,6 @@ interface AlbumArtistDetailContentProps {

export const AlbumArtistDetailContent = ({ background }: AlbumArtistDetailContentProps) => {
const { t } = useTranslation();
const { artistBiographies } = useArtistSettings();
const { artistItems, externalLinks } = useGeneralSettings();
const { albumArtistId } = useParams() as { albumArtistId: string };
const cq = useContainerQuery();
Expand Down Expand Up @@ -372,7 +367,6 @@ export const AlbumArtistDetailContent = ({ background }: AlbumArtistDetailConten
return sanitize(bio);
}, [detailQuery?.data?.biography, enabledItem.biography]);

const showBiography = biography && artistBiographies;
const showTopSongs = topSongsQuery?.data?.items?.length && enabledItem.topSongs;
const showGenres = detailQuery?.data?.genres ? detailQuery?.data?.genres.length !== 0 : false;
const mbzId = detailQuery?.data?.mbz;
Expand Down Expand Up @@ -501,7 +495,7 @@ export const AlbumArtistDetailContent = ({ background }: AlbumArtistDetailConten
</Box>
) : null}
<Grid>
{showBiography ? (
{biography ? (
<Grid.Col
order={itemOrder.biography}
span={12}
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions src/renderer/features/settings/components/pages/pages-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { Stack } from '@mantine/core';
import { HomeSettings } from '/@/renderer/features/settings/components/pages/home-settings';
import { GeneralSettings } from '/@/renderer/features/settings/components/pages/general-settings';
import { SidebarSettings } from '/@/renderer/features/settings/components/pages/sidebar-settings';
import { ArtistSettings } from '/@/renderer/features/settings/components/pages/artist-settings';
import { SidebarReorder } from '/@/renderer/features/settings/components/general/sidebar-reorder';

export const PagesTab = () => {
return (
<Stack spacing="md">
<HomeSettings />
<ArtistSettings />
<GeneralSettings />
<SidebarSettings />
<SidebarReorder />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { SelectItem, Switch } from '@mantine/core';
import { SelectItem } from '@mantine/core';
import isElectron from 'is-electron';
import { Select, Slider, toast } from '/@/renderer/components';
import {
Expand Down Expand Up @@ -131,27 +131,6 @@ export const AudioSettings = ({ hasFancyAudio }: { hasFancyAudio: boolean }) =>
postProcess: 'sentenceCase',
}),
},
{
control: (
<Switch
defaultChecked={settings.webAudio}
onChange={(e) => {
setSettings({
playback: { ...settings, webAudio: e.currentTarget.checked },
});
}}
/>
),
description: t('setting.webAudio', {
context: 'description',
postProcess: 'sentenceCase',
}),
isHidden: settings.type !== PlaybackType.WEB,
note: t('common.restartRequired', { postProcess: 'sentenceCase' }),
title: t('setting.webAudio', {
postProcess: 'sentenceCase',
}),
},
{
control: (
<Slider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ const MpvSettings = lazy(() =>

export const PlaybackTab = () => {
const audioType = useSettingsStore((state) => state.playback.type);
const useWebAudio = useSettingsStore((state) => state.playback.webAudio);

const hasFancyAudio = useMemo(() => {
return (
(isElectron() && audioType === PlaybackType.LOCAL) ||
(useWebAudio && 'AudioContext' in window)
);
}, [audioType, useWebAudio]);
return (isElectron() && audioType === PlaybackType.LOCAL) || 'AudioContext' in window;
}, [audioType]);

return (
<Stack spacing="md">
Expand Down
12 changes: 0 additions & 12 deletions src/renderer/store/settings.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ export type TranscodingConfig = {
};

export interface SettingsState {
artist: {
artistBiographies: boolean;
artistTopSongs: boolean;
};
background: {
backgroundBlurSize: number;
backgroundPlayerCoverType: string;
Expand Down Expand Up @@ -303,7 +299,6 @@ export interface SettingsState {
style: PlaybackStyle;
transcode: TranscodingConfig;
type: PlaybackType;
webAudio: boolean;
};
remote: {
enabled: boolean;
Expand Down Expand Up @@ -354,10 +349,6 @@ const getPlatformDefaultWindowBarStyle = (): Platform => {
const platformDefaultWindowBarStyle: Platform = getPlatformDefaultWindowBarStyle();

const initialState: SettingsState = {
artist: {
artistBiographies: true,
artistTopSongs: true,
},
background: {
backgroundBlurSize: 1.5,
backgroundPlayerCoverType: 'album',
Expand Down Expand Up @@ -499,7 +490,6 @@ const initialState: SettingsState = {
enabled: false,
},
type: PlaybackType.WEB,
webAudio: true,
},
remote: {
enabled: false,
Expand Down Expand Up @@ -798,8 +788,6 @@ export const useFontSettings = () => useSettingsStore((state) => state.font, sha

export const useDiscordSetttings = () => useSettingsStore((state) => state.discord, shallow);

export const useArtistSettings = () => useSettingsStore((state) => state.artist, shallow);

export const useCssSettings = () => useSettingsStore((state) => state.css, shallow);

export const useBackgroundSettings = () => useSettingsStore((state) => state.background, shallow);

0 comments on commit e8e3e68

Please sign in to comment.