mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Cleanup hooks
This commit is contained in:
parent
5b81d4a2fc
commit
cd19e9e5e1
3 changed files with 26 additions and 38 deletions
|
@ -35,8 +35,7 @@ export const useArtistsSearch = (
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['ArtistsSearch', collectionType, parentId, searchTerm],
|
queryKey: ['ArtistsSearch', collectionType, parentId, searchTerm],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: ({ signal }) => fetchArtists(
|
||||||
const artistsData = await fetchArtists(
|
|
||||||
api!,
|
api!,
|
||||||
userId!,
|
userId!,
|
||||||
{
|
{
|
||||||
|
@ -44,10 +43,7 @@ export const useArtistsSearch = (
|
||||||
searchTerm: searchTerm
|
searchTerm: searchTerm
|
||||||
},
|
},
|
||||||
{ signal }
|
{ signal }
|
||||||
);
|
),
|
||||||
|
|
||||||
return artistsData;
|
|
||||||
},
|
|
||||||
enabled: !!api && !!userId && (!collectionType || isMusic(collectionType))
|
enabled: !!api && !!userId && (!collectionType || isMusic(collectionType))
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -37,18 +37,14 @@ export const usePeopleSearch = (
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['PeopleSearch', collectionType, parentId, searchTerm],
|
queryKey: ['PeopleSearch', collectionType, parentId, searchTerm],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: ({ signal }) => fetchPeople(
|
||||||
const peopleData = await fetchPeople(
|
|
||||||
api!,
|
api!,
|
||||||
userId!,
|
userId!,
|
||||||
{
|
{
|
||||||
searchTerm: searchTerm
|
searchTerm: searchTerm
|
||||||
},
|
},
|
||||||
{ signal }
|
{ signal }
|
||||||
);
|
),
|
||||||
|
|
||||||
return peopleData;
|
|
||||||
},
|
|
||||||
enabled: !!api && !!userId && isPeopleEnabled
|
enabled: !!api && !!userId && isPeopleEnabled
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,8 +43,7 @@ export const useVideoSearch = (
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['VideoSearch', collectionType, parentId, searchTerm],
|
queryKey: ['VideoSearch', collectionType, parentId, searchTerm],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: ({ signal }) => fetchPeople(
|
||||||
const videosData = await fetchPeople(
|
|
||||||
api!,
|
api!,
|
||||||
userId!,
|
userId!,
|
||||||
{
|
{
|
||||||
|
@ -52,10 +51,7 @@ export const useVideoSearch = (
|
||||||
searchTerm: searchTerm
|
searchTerm: searchTerm
|
||||||
},
|
},
|
||||||
{ signal }
|
{ signal }
|
||||||
);
|
),
|
||||||
|
|
||||||
return videosData;
|
|
||||||
},
|
|
||||||
enabled: !!api && !!userId && !collectionType
|
enabled: !!api && !!userId && !collectionType
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue