fix: use items endpoint for search

This commit is contained in:
sarendsen
2025-04-08 12:32:43 +02:00
parent 2a4a7f5f2d
commit 29eb072e5d
2 changed files with 8 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ import SeriesPoster from "@/components/posters/SeriesPoster";
import { LoadingSkeleton } from "@/components/search/LoadingSkeleton";
import { SearchItemWrapper } from "@/components/search/SearchItemWrapper";
import { useJellyseerr } from "@/hooks/useJellyseerr";
import { apiAtom } from "@/providers/JellyfinProvider";
import { apiAtom, userAtom } from "@/providers/JellyfinProvider";
import { useSettings } from "@/utils/atoms/settings";
import { eventBus } from "@/utils/eventBus";
import type {
@@ -53,6 +53,8 @@ export default function search() {
const params = useLocalSearchParams();
const insets = useSafeAreaInsets();
const [user] = useAtom(userAtom);
const { t } = useTranslation();
const { q } = params as { q: string };
@@ -100,13 +102,15 @@ export default function search() {
try {
if (searchEngine === "Jellyfin") {
const searchApi = await getSearchApi(api).getSearchHints({
const searchApi = await getItemsApi(api).getItems({
searchTerm: query,
limit: 10,
includeItemTypes: types,
recursive: true,
userId: user?.Id,
});
return (searchApi.data.SearchHints as BaseItemDto[]) || [];
return (searchApi.data.Items as BaseItemDto[]) || [];
}
if (!settings?.marlinServerUrl) {
return [];

View File

@@ -64,7 +64,7 @@
"expo-task-manager": "~12.0.5",
"expo-updates": "~0.26.17",
"expo-web-browser": "~14.0.2",
"ffmpeg-kit-react-native": "git+https://github.com/lufinkey/ffmpreg-kit-react-native",
"ffmpeg-kit-react-native": "git+https://github.com/juliendevleeschauwer/ffmpeg-kit-react-native",
"i18next": "^24.2.2",
"jotai": "^2.11.3",
"lodash": "^4.17.21",