Added scene tags filter.

This commit is contained in:
2024-01-08 02:21:57 +01:00
parent 5db4f18123
commit 7d5efd12ef
17 changed files with 1136 additions and 136 deletions

View File

@@ -3,30 +3,35 @@ import { fetchScenes } from '#/src/scenes.js';
import { curateScenesQuery } from '#/src/web/scenes.js';
export async function onBeforeRender(pageContext) {
const [actor] = await fetchActorsById([Number(pageContext.routeParams.actorId)]);
const [[actor], actorScenes] = await Promise.all([
fetchActorsById([Number(pageContext.routeParams.actorId)]),
fetchScenes(await curateScenesQuery({
...pageContext.urlQuery,
scope: pageContext.routeParams.scope || 'latest',
actorId: Number(pageContext.routeParams.actorId),
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: true,
}),
]);
const {
scenes,
actors,
aggActors,
aggTags,
total,
limit,
} = await fetchScenes(curateScenesQuery({
...pageContext.urlQuery,
scope: pageContext.routeParams.scope || 'latest',
actorId: Number(pageContext.routeParams.actorId),
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: true,
});
} = actorScenes;
return {
pageContext: {
title: actor.name,
pageProps: {
actor,
actors,
scenes,
aggActors,
aggTags,
total,
limit,
},