mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-22 22:00:23 +01:00
fix: correct sf collection use
This commit is contained in:
4
app.json
4
app.json
@@ -2,7 +2,7 @@
|
|||||||
"expo": {
|
"expo": {
|
||||||
"name": "Streamyfin",
|
"name": "Streamyfin",
|
||||||
"slug": "streamyfin",
|
"slug": "streamyfin",
|
||||||
"version": "0.6.2",
|
"version": "0.7.0",
|
||||||
"orientation": "default",
|
"orientation": "default",
|
||||||
"icon": "./assets/images/icon.png",
|
"icon": "./assets/images/icon.png",
|
||||||
"scheme": "streamyfin",
|
"scheme": "streamyfin",
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"jsEngine": "hermes",
|
"jsEngine": "hermes",
|
||||||
"versionCode": 17,
|
"versionCode": 19,
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"foregroundImage": "./assets/images/icon.png"
|
"foregroundImage": "./assets/images/icon.png"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -171,30 +171,19 @@ export default function index() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { data: mediaListCollections } = useQuery({
|
const { data: mediaListCollections } = useQuery({
|
||||||
queryKey: [
|
queryKey: ["sf_promoted", user?.Id, settings?.usePopularPlugin],
|
||||||
"mediaListCollections-home",
|
|
||||||
user?.Id,
|
|
||||||
settings?.mediaListCollectionIds,
|
|
||||||
],
|
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
if (!api || !user?.Id) return [];
|
if (!api || !user?.Id) return [];
|
||||||
|
|
||||||
const response = await getItemsApi(api).getItems({
|
const response = await getItemsApi(api).getItems({
|
||||||
userId: user.Id,
|
userId: user.Id,
|
||||||
tags: ["medialist", "promoted"],
|
tags: ["sf_promoted"],
|
||||||
recursive: true,
|
recursive: true,
|
||||||
fields: ["Tags"],
|
fields: ["Tags"],
|
||||||
includeItemTypes: ["BoxSet"],
|
includeItemTypes: ["BoxSet"],
|
||||||
});
|
});
|
||||||
|
|
||||||
const ids =
|
return response.data.Items || [];
|
||||||
response.data.Items?.filter(
|
|
||||||
(c) =>
|
|
||||||
c.Name !== "cf_carousel" &&
|
|
||||||
settings?.mediaListCollectionIds?.includes(c.Id!)
|
|
||||||
) ?? [];
|
|
||||||
|
|
||||||
return ids;
|
|
||||||
},
|
},
|
||||||
enabled: !!api && !!user?.Id && settings?.usePopularPlugin === true,
|
enabled: !!api && !!user?.Id && settings?.usePopularPlugin === true,
|
||||||
staleTime: 0,
|
staleTime: 0,
|
||||||
@@ -208,7 +197,10 @@ export default function index() {
|
|||||||
await queryClient.refetchQueries({ queryKey: ["recentlyAddedInTVShows"] });
|
await queryClient.refetchQueries({ queryKey: ["recentlyAddedInTVShows"] });
|
||||||
await queryClient.refetchQueries({ queryKey: ["suggestions"] });
|
await queryClient.refetchQueries({ queryKey: ["suggestions"] });
|
||||||
await queryClient.refetchQueries({
|
await queryClient.refetchQueries({
|
||||||
queryKey: ["mediaListCollections-home"],
|
queryKey: ["sf_promoted"],
|
||||||
|
});
|
||||||
|
await queryClient.refetchQueries({
|
||||||
|
queryKey: ["sf_carousel"],
|
||||||
});
|
});
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}, [queryClient, user?.Id]);
|
}, [queryClient, user?.Id]);
|
||||||
|
|||||||
@@ -31,6 +31,25 @@ export const LargeMovieCarousel: React.FC<Props> = ({ ...props }) => {
|
|||||||
const [api] = useAtom(apiAtom);
|
const [api] = useAtom(apiAtom);
|
||||||
const [user] = useAtom(userAtom);
|
const [user] = useAtom(userAtom);
|
||||||
|
|
||||||
|
const { data: sf_carousel, isFetching: l1 } = useQuery({
|
||||||
|
queryKey: ["sf_carousel", user?.Id, settings?.mediaListCollectionIds],
|
||||||
|
queryFn: async () => {
|
||||||
|
if (!api || !user?.Id) return null;
|
||||||
|
|
||||||
|
const response = await getItemsApi(api).getItems({
|
||||||
|
userId: user.Id,
|
||||||
|
tags: ["sf_carousel"],
|
||||||
|
recursive: true,
|
||||||
|
fields: ["Tags"],
|
||||||
|
includeItemTypes: ["BoxSet"],
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data.Items?.[0].Id || null;
|
||||||
|
},
|
||||||
|
enabled: !!api && !!user?.Id && settings?.usePopularPlugin === true,
|
||||||
|
staleTime: 0,
|
||||||
|
});
|
||||||
|
|
||||||
const onPressPagination = (index: number) => {
|
const onPressPagination = (index: number) => {
|
||||||
ref.current?.scrollTo({
|
ref.current?.scrollTo({
|
||||||
/**
|
/**
|
||||||
@@ -42,40 +61,20 @@ export const LargeMovieCarousel: React.FC<Props> = ({ ...props }) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const { data: mediaListCollection, isLoading: l1 } = useQuery<string | null>({
|
const { data: popularItems, isFetching: l2 } = useQuery<BaseItemDto[]>({
|
||||||
queryKey: ["mediaListCollection", user?.Id],
|
|
||||||
queryFn: async () => {
|
|
||||||
if (!api || !user?.Id) return null;
|
|
||||||
|
|
||||||
const response = await getItemsApi(api).getItems({
|
|
||||||
userId: user.Id,
|
|
||||||
tags: ["medialist", "promoted"],
|
|
||||||
recursive: true,
|
|
||||||
fields: ["Tags"],
|
|
||||||
includeItemTypes: ["BoxSet"],
|
|
||||||
});
|
|
||||||
|
|
||||||
const id = response.data.Items?.find((c) => c.Name === "sf_carousel")?.Id;
|
|
||||||
return id || null;
|
|
||||||
},
|
|
||||||
enabled: !!api && !!user?.Id && settings?.usePopularPlugin === true,
|
|
||||||
staleTime: 0,
|
|
||||||
});
|
|
||||||
|
|
||||||
const { data: popularItems, isLoading: l2 } = useQuery<BaseItemDto[]>({
|
|
||||||
queryKey: ["popular", user?.Id],
|
queryKey: ["popular", user?.Id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
if (!api || !user?.Id || !mediaListCollection) return [];
|
if (!api || !user?.Id || !sf_carousel) return [];
|
||||||
|
|
||||||
const response = await getItemsApi(api).getItems({
|
const response = await getItemsApi(api).getItems({
|
||||||
userId: user.Id,
|
userId: user.Id,
|
||||||
parentId: mediaListCollection,
|
parentId: sf_carousel,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
return response.data.Items || [];
|
return response.data.Items || [];
|
||||||
},
|
},
|
||||||
enabled: !!api && !!user?.Id && !!mediaListCollection,
|
enabled: !!api && !!user?.Id && !!sf_carousel,
|
||||||
staleTime: 0,
|
staleTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -25,22 +25,19 @@ export const SettingToggles: React.FC = () => {
|
|||||||
data: mediaListCollections,
|
data: mediaListCollections,
|
||||||
isLoading: isLoadingMediaListCollections,
|
isLoading: isLoadingMediaListCollections,
|
||||||
} = useQuery({
|
} = useQuery({
|
||||||
queryKey: ["mediaListCollections", user?.Id],
|
queryKey: ["sf_promoted", user?.Id, settings?.usePopularPlugin],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
if (!api || !user?.Id) return [];
|
if (!api || !user?.Id) return [];
|
||||||
|
|
||||||
const response = await getItemsApi(api).getItems({
|
const response = await getItemsApi(api).getItems({
|
||||||
userId: user.Id,
|
userId: user.Id,
|
||||||
tags: ["medialist", "promoted"],
|
tags: ["sf_promoted"],
|
||||||
recursive: true,
|
recursive: true,
|
||||||
fields: ["Tags"],
|
fields: ["Tags"],
|
||||||
includeItemTypes: ["BoxSet"],
|
includeItemTypes: ["BoxSet"],
|
||||||
});
|
});
|
||||||
|
|
||||||
const ids =
|
return response.data.Items ?? [];
|
||||||
response.data.Items?.filter((c) => c.Name !== "sf_carousel") ?? [];
|
|
||||||
|
|
||||||
return ids;
|
|
||||||
},
|
},
|
||||||
enabled: !!api && !!user?.Id && settings?.usePopularPlugin === true,
|
enabled: !!api && !!user?.Id && settings?.usePopularPlugin === true,
|
||||||
staleTime: 0,
|
staleTime: 0,
|
||||||
|
|||||||
4
eas.json
4
eas.json
@@ -21,13 +21,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"production": {
|
"production": {
|
||||||
"channel": "0.6.2",
|
"channel": "0.7.0",
|
||||||
"android": {
|
"android": {
|
||||||
"image": "latest"
|
"image": "latest"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"production-apk": {
|
"production-apk": {
|
||||||
"channel": "0.6.2",
|
"channel": "0.7.0",
|
||||||
"android": {
|
"android": {
|
||||||
"buildType": "apk",
|
"buildType": "apk",
|
||||||
"image": "latest"
|
"image": "latest"
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({
|
|||||||
setJellyfin(
|
setJellyfin(
|
||||||
() =>
|
() =>
|
||||||
new Jellyfin({
|
new Jellyfin({
|
||||||
clientInfo: { name: "Streamyfin", version: "0.6.2" },
|
clientInfo: { name: "Streamyfin", version: "0.7.0" },
|
||||||
deviceInfo: { name: Platform.OS === "ios" ? "iOS" : "Android", id },
|
deviceInfo: { name: Platform.OS === "ios" ? "iOS" : "Android", id },
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user