From 8686a7c5923a4fa70b90161367cc6b2a917357b7 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Mon, 7 Aug 2023 21:59:55 -0700 Subject: [PATCH] Various lyrics improvements - Update wording on provider fetcher - Invalidate query on reset instead of resetQuery --- src/main/features/core/lyrics/index.ts | 18 +++++++++--------- src/renderer/features/lyrics/lyrics.tsx | 2 +- .../features/lyrics/unsynchronized-lyrics.tsx | 4 ++-- .../components/playback/lyric-settings.tsx | 5 +++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main/features/core/lyrics/index.ts b/src/main/features/core/lyrics/index.ts index 49345a1b..c26cb853 100644 --- a/src/main/features/core/lyrics/index.ts +++ b/src/main/features/core/lyrics/index.ts @@ -1,13 +1,4 @@ import { ipcMain } from 'electron'; -import { - InternetProviderLyricResponse, - InternetProviderLyricSearchResponse, - LyricSearchQuery, - QueueSong, - LyricGetQuery, - LyricSource, -} from '../../../../renderer/api/types'; -import { store } from '../settings/index'; import { query as queryGenius, getSearchResults as searchGenius, @@ -23,6 +14,15 @@ import { getSearchResults as searchNetease, getLyricsBySongId as getNetease, } from './netease'; +import { + InternetProviderLyricResponse, + InternetProviderLyricSearchResponse, + LyricSearchQuery, + QueueSong, + LyricGetQuery, + LyricSource, +} from '../../../../renderer/api/types'; +import { store } from '../settings/index'; type SongFetcher = (params: LyricSearchQuery) => Promise; type SearchFetcher = ( diff --git a/src/renderer/features/lyrics/lyrics.tsx b/src/renderer/features/lyrics/lyrics.tsx index 027dde5f..28e58f1e 100644 --- a/src/renderer/features/lyrics/lyrics.tsx +++ b/src/renderer/features/lyrics/lyrics.tsx @@ -111,7 +111,7 @@ export const Lyrics = () => { }, []); const handleOnResetLyric = useCallback(() => { - queryClient.resetQueries({ + queryClient.invalidateQueries({ exact: true, queryKey: queryKeys.songs.lyrics(currentSong?.serverId, { songId: currentSong?.id }), }); diff --git a/src/renderer/features/lyrics/unsynchronized-lyrics.tsx b/src/renderer/features/lyrics/unsynchronized-lyrics.tsx index f456bd67..74567a9f 100644 --- a/src/renderer/features/lyrics/unsynchronized-lyrics.tsx +++ b/src/renderer/features/lyrics/unsynchronized-lyrics.tsx @@ -48,7 +48,7 @@ export const UnsynchronizedLyrics = ({ $gap={settings.gapUnsync} className="unsynchronized-lyrics" > - {source && ( + {settings.showProvider && source && ( )} - {remote && ( + {settings.showMatch && remote && ( { }} /> ), - 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(), - title: 'Providers to fetch music', + title: 'Providers to fetch lyrics', }, { control: (