Added movies overview page. Fixed channel filter duplicates.

This commit is contained in:
2024-02-27 01:20:15 +01:00
parent ae36a951a0
commit f29246050b
25 changed files with 993 additions and 48 deletions

View File

@@ -0,0 +1,36 @@
import { fetchMovies } from '#/src/movies.js';
import { curateMoviesQuery } from '#/src/web/movies.js';
export async function onBeforeRender(pageContext) {
const movieResults = await fetchMovies(await curateMoviesQuery({
...pageContext.urlQuery,
scope: pageContext.routeParams.scope || 'latest',
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 50,
aggregate: true,
});
const {
movies,
aggActors,
aggTags,
aggChannels,
total,
limit,
} = movieResults;
return {
pageContext: {
title: 'Movies',
pageProps: {
movies,
aggActors,
aggTags,
aggChannels,
limit,
total,
},
},
};
}