Added basic actor page with scenes and co-star filtering.

This commit is contained in:
2024-01-07 06:13:40 +01:00
parent ffcb77ab45
commit e32a366fff
14 changed files with 476 additions and 144 deletions

View File

@@ -2,6 +2,7 @@
<div>
<Scenes
:scenes="scenes"
:show-filters="false"
/>
</div>
</template>
@@ -9,7 +10,7 @@
<script setup>
import { inject } from 'vue';
import Scenes from '../../components/scenes/scenes.vue';
import Scenes from '#/components/scenes/scenes.vue';
const { pageProps } = inject('pageContext');
const { scenes } = pageProps;

View File

@@ -1,21 +1,13 @@
import { fetchLatest, fetchUpcoming, fetchNew } from '#/src/scenes.js';
async function fetchScenes(scope, page, limit) {
if (scope === 'new') {
return fetchNew(page, { limit });
}
if (scope === 'upcoming') {
return fetchUpcoming(page, { limit });
}
return fetchLatest(page, { limit });
}
import { fetchScenes } from '#/src/scenes.js';
export async function onBeforeRender(pageContext) {
const { scenes, limit, total } = await fetchScenes(pageContext.routeParams.scope, Number(pageContext.routeParams.page) || 1, Number(pageContext.urlParsed.search.limit) || 30);
// console.log(scenes);
const { scenes, limit, total } = await fetchScenes({
scope: pageContext.routeParams.scope || 'latest',
}, {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: false,
});
return {
pageContext: {