diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index ff2f28f28..e36442cf2 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -29,9 +29,13 @@ const Search: React.FC = () => { titles, fetchMore, error, - } = useDiscover(`/api/v1/search`, { - query: router.query.query, - }); + } = useDiscover( + `/api/v1/search`, + { + query: router.query.query, + }, + { hideAvailable: false } + ); if (error) { return ; diff --git a/src/hooks/useDiscover.ts b/src/hooks/useDiscover.ts index 3bb73a3c3..ecba66893 100644 --- a/src/hooks/useDiscover.ts +++ b/src/hooks/useDiscover.ts @@ -31,7 +31,8 @@ interface DiscoverResult { const useDiscover = >( endpoint: string, - options?: Record + options?: Record, + { hideAvailable = true } = {} ): DiscoverResult => { const settings = useSettings(); const { locale } = useContext(LanguageContext); @@ -74,7 +75,7 @@ const useDiscover = >( let titles = (data ?? []).reduce((a, v) => [...a, ...v.results], [] as T[]); - if (settings.currentSettings.hideAvailable) { + if (settings.currentSettings.hideAvailable && hideAvailable) { titles = titles.filter( (i) => (i.mediaType === 'movie' || i.mediaType === 'tv') &&