mirror of
https://github.com/jeffvli/feishin.git
synced 2024-11-20 06:27:09 +01:00
Various lyrics improvements
- Update wording on provider fetcher - Invalidate query on reset instead of resetQuery
This commit is contained in:
parent
59a851f8c8
commit
8686a7c592
@ -1,13 +1,4 @@
|
|||||||
import { ipcMain } from 'electron';
|
import { ipcMain } from 'electron';
|
||||||
import {
|
|
||||||
InternetProviderLyricResponse,
|
|
||||||
InternetProviderLyricSearchResponse,
|
|
||||||
LyricSearchQuery,
|
|
||||||
QueueSong,
|
|
||||||
LyricGetQuery,
|
|
||||||
LyricSource,
|
|
||||||
} from '../../../../renderer/api/types';
|
|
||||||
import { store } from '../settings/index';
|
|
||||||
import {
|
import {
|
||||||
query as queryGenius,
|
query as queryGenius,
|
||||||
getSearchResults as searchGenius,
|
getSearchResults as searchGenius,
|
||||||
@ -23,6 +14,15 @@ import {
|
|||||||
getSearchResults as searchNetease,
|
getSearchResults as searchNetease,
|
||||||
getLyricsBySongId as getNetease,
|
getLyricsBySongId as getNetease,
|
||||||
} from './netease';
|
} from './netease';
|
||||||
|
import {
|
||||||
|
InternetProviderLyricResponse,
|
||||||
|
InternetProviderLyricSearchResponse,
|
||||||
|
LyricSearchQuery,
|
||||||
|
QueueSong,
|
||||||
|
LyricGetQuery,
|
||||||
|
LyricSource,
|
||||||
|
} from '../../../../renderer/api/types';
|
||||||
|
import { store } from '../settings/index';
|
||||||
|
|
||||||
type SongFetcher = (params: LyricSearchQuery) => Promise<InternetProviderLyricResponse | null>;
|
type SongFetcher = (params: LyricSearchQuery) => Promise<InternetProviderLyricResponse | null>;
|
||||||
type SearchFetcher = (
|
type SearchFetcher = (
|
||||||
|
@ -111,7 +111,7 @@ export const Lyrics = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleOnResetLyric = useCallback(() => {
|
const handleOnResetLyric = useCallback(() => {
|
||||||
queryClient.resetQueries({
|
queryClient.invalidateQueries({
|
||||||
exact: true,
|
exact: true,
|
||||||
queryKey: queryKeys.songs.lyrics(currentSong?.serverId, { songId: currentSong?.id }),
|
queryKey: queryKeys.songs.lyrics(currentSong?.serverId, { songId: currentSong?.id }),
|
||||||
});
|
});
|
||||||
|
@ -48,7 +48,7 @@ export const UnsynchronizedLyrics = ({
|
|||||||
$gap={settings.gapUnsync}
|
$gap={settings.gapUnsync}
|
||||||
className="unsynchronized-lyrics"
|
className="unsynchronized-lyrics"
|
||||||
>
|
>
|
||||||
{source && (
|
{settings.showProvider && source && (
|
||||||
<LyricLine
|
<LyricLine
|
||||||
alignment={settings.alignment}
|
alignment={settings.alignment}
|
||||||
className="lyric-credit"
|
className="lyric-credit"
|
||||||
@ -56,7 +56,7 @@ export const UnsynchronizedLyrics = ({
|
|||||||
text={`Provided by ${source}`}
|
text={`Provided by ${source}`}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{remote && (
|
{settings.showMatch && remote && (
|
||||||
<LyricLine
|
<LyricLine
|
||||||
alignment={settings.alignment}
|
alignment={settings.alignment}
|
||||||
className="lyric-credit"
|
className="lyric-credit"
|
||||||
|
@ -77,9 +77,10 @@ export const LyricSettings = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
description: 'List of lyric fetchers (in order of preference)',
|
description:
|
||||||
|
'Lyric fetchers should be added in order of preference. This is the order in which they will be queried.',
|
||||||
isHidden: !isElectron(),
|
isHidden: !isElectron(),
|
||||||
title: 'Providers to fetch music',
|
title: 'Providers to fetch lyrics',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
control: (
|
control: (
|
||||||
|
Loading…
Reference in New Issue
Block a user