mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
Add remote control (#164)
* draft add remotes * add favorite, rating * add basic auth
This commit is contained in:
parent
0a13d047bb
commit
c9dbf9b5be
66 changed files with 2585 additions and 298 deletions
|
|
@ -152,8 +152,8 @@ export const useSongLyricsByRemoteId = (
|
|||
enabled: !!query.remoteSongId && !!query.remoteSource,
|
||||
onError: () => {},
|
||||
queryFn: async () => {
|
||||
const remoteLyricsResult: string | null = await lyricsIpc?.getRemoteLyricsByRemoteId(
|
||||
query,
|
||||
const remoteLyricsResult = await lyricsIpc?.getRemoteLyricsByRemoteId(
|
||||
query as LyricGetQuery,
|
||||
);
|
||||
|
||||
if (remoteLyricsResult) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,12 @@ export const useLyricSearch = (args: Omit<QueryHookArgs<LyricSearchQuery>, 'serv
|
|||
return useQuery<Record<LyricSource, InternetProviderLyricSearchResponse[]>>({
|
||||
cacheTime: 1000 * 60 * 1,
|
||||
enabled: !!query.artist || !!query.name,
|
||||
queryFn: () => lyricsIpc?.searchRemoteLyrics(query),
|
||||
queryFn: () => {
|
||||
if (lyricsIpc) {
|
||||
return lyricsIpc.searchRemoteLyrics(query);
|
||||
}
|
||||
return {} as Record<LyricSource, InternetProviderLyricSearchResponse[]>;
|
||||
},
|
||||
queryKey: queryKeys.songs.lyricsSearch(query),
|
||||
staleTime: 1000 * 60 * 1,
|
||||
...options,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue