fix(frontend): never hide available content in search results

pull/1143/merge
sct 4 years ago
parent a51d2a24d5
commit d48edeb5a9

@ -29,9 +29,13 @@ const Search: React.FC = () => {
titles,
fetchMore,
error,
} = useDiscover<MovieResult | TvResult | PersonResult>(`/api/v1/search`, {
query: router.query.query,
});
} = useDiscover<MovieResult | TvResult | PersonResult>(
`/api/v1/search`,
{
query: router.query.query,
},
{ hideAvailable: false }
);
if (error) {
return <Error statusCode={500} />;

@ -31,7 +31,8 @@ interface DiscoverResult<T, S> {
const useDiscover = <T extends BaseMedia, S = Record<string, never>>(
endpoint: string,
options?: Record<string, unknown>
options?: Record<string, unknown>,
{ hideAvailable = true } = {}
): DiscoverResult<T, S> => {
const settings = useSettings();
const { locale } = useContext(LanguageContext);
@ -74,7 +75,7 @@ const useDiscover = <T extends BaseMedia, S = Record<string, never>>(
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') &&

Loading…
Cancel
Save