mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Refactor query keys
This commit is contained in:
parent
533ea7dbb9
commit
f7e09708fc
5 changed files with 5 additions and 5 deletions
|
@ -34,7 +34,7 @@ export const useArtistsSearch = (
|
|||
const userId = user?.Id;
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['ArtistsSearch', collectionType, parentId, searchTerm],
|
||||
queryKey: ['Search', 'Artists', collectionType, parentId, searchTerm],
|
||||
queryFn: ({ signal }) => fetchArtists(
|
||||
api!,
|
||||
userId!,
|
||||
|
|
|
@ -142,7 +142,7 @@ export const useLiveTvSearch = (
|
|||
const userId = user?.Id;
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['LiveTv', collectionType, parentId, searchTerm],
|
||||
queryKey: ['Search', 'LiveTv', collectionType, parentId, searchTerm],
|
||||
queryFn: ({ signal }) =>
|
||||
fetchLiveTv(api!, userId!, searchTerm, signal),
|
||||
enabled: !!api && !!userId && !!collectionType && !!isLivetv(collectionType)
|
||||
|
|
|
@ -36,7 +36,7 @@ export const usePeopleSearch = (
|
|||
const isPeopleEnabled = (!collectionType || isMovies(collectionType) || isTVShows(collectionType));
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['PeopleSearch', collectionType, parentId, searchTerm],
|
||||
queryKey: ['Search', 'People', collectionType, parentId, searchTerm],
|
||||
queryFn: ({ signal }) => fetchPeople(
|
||||
api!,
|
||||
userId!,
|
||||
|
|
|
@ -29,7 +29,7 @@ export const useSearchItems = (
|
|||
const isLiveTvEnabled = !isLiveTvPending || !collectionType || !isLivetv(collectionType);
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['SearchItems', collectionType, parentId, searchTerm],
|
||||
queryKey: ['Search', 'Items', collectionType, parentId, searchTerm],
|
||||
queryFn: async ({ signal }) => {
|
||||
if (liveTvSections && collectionType && isLivetv(collectionType)) {
|
||||
return sortSections(liveTvSections);
|
||||
|
|
|
@ -42,7 +42,7 @@ export const useVideoSearch = (
|
|||
const userId = user?.Id;
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['VideoSearch', collectionType, parentId, searchTerm],
|
||||
queryKey: ['Search', 'Video', collectionType, parentId, searchTerm],
|
||||
queryFn: ({ signal }) => fetchVideos(
|
||||
api!,
|
||||
userId!,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue