diff --git a/src/apps/stable/features/search/api/useVideoSearch.ts b/src/apps/stable/features/search/api/useVideoSearch.ts index d5711b1987..3eafbd46da 100644 --- a/src/apps/stable/features/search/api/useVideoSearch.ts +++ b/src/apps/stable/features/search/api/useVideoSearch.ts @@ -9,7 +9,7 @@ import { MediaType } from '@jellyfin/sdk/lib/generated-client/models/media-type' import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind'; import { ItemsApiGetItemsRequest } from '@jellyfin/sdk/lib/generated-client/api/items-api'; -const fetchPeople = async ( +const fetchVideos = async ( api: Api, userId: string, params?: ItemsApiGetItemsRequest, @@ -43,7 +43,7 @@ export const useVideoSearch = ( return useQuery({ queryKey: ['VideoSearch', collectionType, parentId, searchTerm], - queryFn: ({ signal }) => fetchPeople( + queryFn: ({ signal }) => fetchVideos( api!, userId!, { diff --git a/src/apps/stable/features/search/components/SearchResults.tsx b/src/apps/stable/features/search/components/SearchResults.tsx index 8b76b5cbc0..1f20c15ebb 100644 --- a/src/apps/stable/features/search/components/SearchResults.tsx +++ b/src/apps/stable/features/search/components/SearchResults.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, type FC } from 'react'; +import React, { type FC } from 'react'; import { useSearchItems } from '../api/useSearchItems'; import globalize from '../../../../../lib/globalize'; import Loading from '../../../../../components/loading/LoadingComponent'; @@ -6,8 +6,7 @@ import SearchResultsRow from './SearchResultsRow'; import { CardShape } from 'utils/card'; import { CollectionType } from '@jellyfin/sdk/lib/generated-client/models/collection-type'; import { Section } from '../types'; -import LinkButton from 'elements/emby-button/LinkButton'; -import { useLocation, useSearchParams } from 'react-router-dom'; +import { Link } from 'react-router-dom'; interface SearchResultsProps { parentId?: string; @@ -24,13 +23,6 @@ const SearchResults: FC = ({ query }) => { const { data, isPending } = useSearchItems(parentId, collectionType, query?.trim()); - const location = useLocation(); - const [ searchParams ] = useSearchParams(); - - const getUri = useCallback(() => { - searchParams.delete('collectionType'); - return `${location.pathname}?${searchParams.toString()}`; - }, [ searchParams, location.pathname ]); if (isPending) return ; @@ -40,7 +32,10 @@ const SearchResults: FC = ({ {globalize.translate('SearchResultsEmpty', query)} {collectionType && (
- {globalize.translate('RetryWithGlobalSearch')} + {globalize.translate('RetryWithGlobalSearch')}
)} diff --git a/src/apps/stable/routes/search.tsx b/src/apps/stable/routes/search.tsx index 140c88c69a..f06ce927d8 100644 --- a/src/apps/stable/routes/search.tsx +++ b/src/apps/stable/routes/search.tsx @@ -51,7 +51,7 @@ const Search: FC = () => { className='mainAnimatedPage libraryPage allLibraryPage noSecondaryNavPage' > - {!query ? ( + {!debouncedQuery ? (