mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
feat: Implement latest for custom home
This commit is contained in:
@@ -359,10 +359,19 @@ export const HomeIndex = () => {
|
|||||||
fields: ["MediaSourceCount"],
|
fields: ["MediaSourceCount"],
|
||||||
limit: section.items?.limit || 25,
|
limit: section.items?.limit || 25,
|
||||||
enableImageTypes: ["Primary", "Backdrop", "Thumb"],
|
enableImageTypes: ["Primary", "Backdrop", "Thumb"],
|
||||||
enableResumable: section.items?.enableResumable || false,
|
enableResumable: section.items?.enableResumable,
|
||||||
enableRewatching: section.items?.enableRewatching || false,
|
enableRewatching: section.items?.enableRewatching,
|
||||||
});
|
});
|
||||||
return response.data.Items || [];
|
return response.data.Items || [];
|
||||||
|
} else if (section.latest) {
|
||||||
|
const response = await getUserLibraryApi(api).getLatestMedia({
|
||||||
|
userId: user?.Id,
|
||||||
|
includeItemTypes: section.latest?.includeItemTypes,
|
||||||
|
limit: section.latest?.limit || 25,
|
||||||
|
isPlayed: section.latest?.isPlayed,
|
||||||
|
groupItems: section.latest?.groupItems,
|
||||||
|
});
|
||||||
|
return response.data || [];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export type HomeSection = {
|
|||||||
orientation?: "horizontal" | "vertical";
|
orientation?: "horizontal" | "vertical";
|
||||||
items?: HomeSectionItemResolver;
|
items?: HomeSectionItemResolver;
|
||||||
nextUp?: HomeSectionNextUpResolver;
|
nextUp?: HomeSectionNextUpResolver;
|
||||||
|
latest?: HomeSectionLatestResolver;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type HomeSectionItemResolver = {
|
export type HomeSectionItemResolver = {
|
||||||
@@ -113,6 +114,14 @@ export type HomeSectionNextUpResolver = {
|
|||||||
enableRewatching?: boolean;
|
enableRewatching?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type HomeSectionLatestResolver = {
|
||||||
|
parentId?: string;
|
||||||
|
limit?: number;
|
||||||
|
groupItems?: boolean;
|
||||||
|
isPlayed?: boolean;
|
||||||
|
includeItemTypes?: Array<BaseItemKind>;
|
||||||
|
};
|
||||||
|
|
||||||
export enum VideoPlayer {
|
export enum VideoPlayer {
|
||||||
// NATIVE, //todo: changes will make this a lot more easier to implement if we want. delete if not wanted
|
// NATIVE, //todo: changes will make this a lot more easier to implement if we want. delete if not wanted
|
||||||
VLC_3 = 0,
|
VLC_3 = 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user