mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
refactor: home section lists
This commit is contained in:
@@ -306,9 +306,10 @@ export default function index() {
|
|||||||
|
|
||||||
for (const key in settings.home?.sections) {
|
for (const key in settings.home?.sections) {
|
||||||
const section = settings.home?.sections[key];
|
const section = settings.home?.sections[key];
|
||||||
|
const id = section.title || key;
|
||||||
ss.push({
|
ss.push({
|
||||||
title: key,
|
title: id,
|
||||||
queryKey: ["home", key],
|
queryKey: ["home", id],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
if (section.items) {
|
if (section.items) {
|
||||||
const response = await getItemsApi(api).getItems({
|
const response = await getItemsApi(api).getItems({
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export enum DownloadMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type Home = {
|
export type Home = {
|
||||||
sections: [Object];
|
sections: Array<HomeSection>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type HomeSection = {
|
export type HomeSection = {
|
||||||
@@ -84,6 +84,7 @@ export type HomeSection = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type HomeSectionItemResolver = {
|
export type HomeSectionItemResolver = {
|
||||||
|
title?: string;
|
||||||
sortBy?: Array<ItemSortBy>;
|
sortBy?: Array<ItemSortBy>;
|
||||||
sortOrder?: Array<SortOrder>;
|
sortOrder?: Array<SortOrder>;
|
||||||
includeItemTypes?: Array<BaseItemKind>;
|
includeItemTypes?: Array<BaseItemKind>;
|
||||||
|
|||||||
Reference in New Issue
Block a user