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;
|
const userId = user?.Id;
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['ArtistsSearch', collectionType, parentId, searchTerm],
|
queryKey: ['Search', 'Artists', collectionType, parentId, searchTerm],
|
||||||
queryFn: ({ signal }) => fetchArtists(
|
queryFn: ({ signal }) => fetchArtists(
|
||||||
api!,
|
api!,
|
||||||
userId!,
|
userId!,
|
||||||
|
|
|
@ -142,7 +142,7 @@ export const useLiveTvSearch = (
|
||||||
const userId = user?.Id;
|
const userId = user?.Id;
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['LiveTv', collectionType, parentId, searchTerm],
|
queryKey: ['Search', 'LiveTv', collectionType, parentId, searchTerm],
|
||||||
queryFn: ({ signal }) =>
|
queryFn: ({ signal }) =>
|
||||||
fetchLiveTv(api!, userId!, searchTerm, signal),
|
fetchLiveTv(api!, userId!, searchTerm, signal),
|
||||||
enabled: !!api && !!userId && !!collectionType && !!isLivetv(collectionType)
|
enabled: !!api && !!userId && !!collectionType && !!isLivetv(collectionType)
|
||||||
|
|
|
@ -36,7 +36,7 @@ export const usePeopleSearch = (
|
||||||
const isPeopleEnabled = (!collectionType || isMovies(collectionType) || isTVShows(collectionType));
|
const isPeopleEnabled = (!collectionType || isMovies(collectionType) || isTVShows(collectionType));
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['PeopleSearch', collectionType, parentId, searchTerm],
|
queryKey: ['Search', 'People', collectionType, parentId, searchTerm],
|
||||||
queryFn: ({ signal }) => fetchPeople(
|
queryFn: ({ signal }) => fetchPeople(
|
||||||
api!,
|
api!,
|
||||||
userId!,
|
userId!,
|
||||||
|
|
|
@ -29,7 +29,7 @@ export const useSearchItems = (
|
||||||
const isLiveTvEnabled = !isLiveTvPending || !collectionType || !isLivetv(collectionType);
|
const isLiveTvEnabled = !isLiveTvPending || !collectionType || !isLivetv(collectionType);
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['SearchItems', collectionType, parentId, searchTerm],
|
queryKey: ['Search', 'Items', collectionType, parentId, searchTerm],
|
||||||
queryFn: async ({ signal }) => {
|
queryFn: async ({ signal }) => {
|
||||||
if (liveTvSections && collectionType && isLivetv(collectionType)) {
|
if (liveTvSections && collectionType && isLivetv(collectionType)) {
|
||||||
return sortSections(liveTvSections);
|
return sortSections(liveTvSections);
|
||||||
|
|
|
@ -42,7 +42,7 @@ export const useVideoSearch = (
|
||||||
const userId = user?.Id;
|
const userId = user?.Id;
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['VideoSearch', collectionType, parentId, searchTerm],
|
queryKey: ['Search', 'Video', collectionType, parentId, searchTerm],
|
||||||
queryFn: ({ signal }) => fetchVideos(
|
queryFn: ({ signal }) => fetchVideos(
|
||||||
api!,
|
api!,
|
||||||
userId!,
|
userId!,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue