Added actors and movies to global search results.

This commit is contained in:
2024-06-02 05:22:08 +02:00
parent b144728e5f
commit 5b4aa9644b
13 changed files with 284 additions and 65 deletions

View File

@@ -1,13 +1,18 @@
<template>
<div>
<Scenes
:show-filters="false"
:show-meta="false"
:show-scope-tabs="true"
:show-filters="!!query"
:show-meta="!!query"
:show-scope-tabs="!query"
/>
</div>
</template>
<script setup>
import { inject } from 'vue';
import Scenes from '#/components/scenes/scenes.vue';
const pageContext = inject('pageContext');
const query = Object.hasOwn(pageContext.urlParsed.search, 'q');
</script>

View File

@@ -2,15 +2,24 @@ import { fetchScenes } from '#/src/scenes.js';
import { curateScenesQuery } from '#/src/web/scenes.js';
export async function onBeforeRender(pageContext) {
const { scenes, limit, total } = await fetchScenes(await curateScenesQuery({
const withQuery = Object.hasOwn(pageContext.urlParsed.search, 'q');
const {
scenes,
aggTags,
aggChannels,
aggActors,
limit,
total,
} = await fetchScenes(await curateScenesQuery({
...pageContext.urlQuery,
scope: pageContext.routeParams.scope || 'latest',
isShowcased: true,
isShowcased: withQuery ? null : true,
tagFilter: pageContext.tagFilter,
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: false,
aggregate: withQuery,
}, pageContext.user);
return {
@@ -18,6 +27,9 @@ export async function onBeforeRender(pageContext) {
title: pageContext.routeParams.scope,
pageProps: {
scenes,
aggTags,
aggChannels,
aggActors,
limit,
total,
},