Add lyric search selection and override

This commit is contained in:
jeffvli 2023-06-09 02:38:04 -07:00 committed by Jeff
parent f8ecb3fc53
commit 2f0634dc03
6 changed files with 140 additions and 35 deletions

View file

@ -1,4 +1,5 @@
import { QueryFunctionContext } from '@tanstack/react-query';
import { LyricSource } from './types';
import type {
AlbumListQuery,
SongListQuery,
@ -108,6 +109,9 @@ export const queryKeys: Record<
if (query) return [serverId, 'song', 'lyrics', query] as const;
return [serverId, 'song', 'lyrics'] as const;
},
lyricsByRemoteId: (searchQuery: { remoteSongId: string; remoteSource: LyricSource }) => {
return ['song', 'lyrics', 'remote', searchQuery] as const;
},
lyricsSearch: (query?: LyricSearchQuery) => {
if (query) return ['lyrics', 'search', query] as const;
return ['lyrics', 'search'] as const;