Removed info channels from overview. Fixed poster gap.

This commit is contained in:
2024-06-12 17:09:53 +02:00
parent bfe6dc866d
commit 41d6324c28
13 changed files with 302 additions and 99 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div class="updates">
<Scenes
:show-filters="!!query"
:show-meta="!!query"
@@ -16,3 +16,10 @@ import Scenes from '#/components/scenes/scenes.vue';
const pageContext = inject('pageContext');
const query = Object.hasOwn(pageContext.urlParsed.search, 'q');
</script>
<style scoped>
.updates {
display: flex;
flex-grow: 1;
}
</style>

View File

@@ -1,10 +1,31 @@
import { fetchScenes } from '#/src/scenes.js';
import { curateScenesQuery } from '#/src/web/scenes.js';
import { getRandomCampaign } from '#/src/campaigns.js';
import { getRandomCampaigns } from '#/src/campaigns.js';
export async function onBeforeRender(pageContext) {
const withQuery = Object.hasOwn(pageContext.urlParsed.search, 'q');
const [
sceneResults,
campaigns,
] = await Promise.all([
fetchScenes(await curateScenesQuery({
...pageContext.urlQuery,
scope: pageContext.routeParams.scope || 'latest',
isShowcased: withQuery ? null : true,
tagFilter: pageContext.tagFilter,
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 29,
aggregate: withQuery,
}, pageContext.user),
getRandomCampaigns([
{ minRatio: 1.5 },
{ minRatio: 0.75, maxRatio: 1.25 },
{ minRatio: 1.5 },
]),
]);
const {
scenes,
aggTags,
@@ -12,20 +33,10 @@ export async function onBeforeRender(pageContext) {
aggActors,
limit,
total,
} = await fetchScenes(await curateScenesQuery({
...pageContext.urlQuery,
scope: pageContext.routeParams.scope || 'latest',
isShowcased: withQuery ? null : true,
tagFilter: pageContext.tagFilter,
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 29,
aggregate: withQuery,
}, pageContext.user);
} = sceneResults;
// const campaignIndex = Math.floor(Math.random() * (scenes.length - 5)) + 5;
const campaignIndex = Math.floor((Math.random() * (0.5 - 0.2) + 0.2) * scenes.length);
const sceneCampaign = await getRandomCampaign({ minRatio: 0.75, maxRatio: 1.25 });
const [scopeCampaign, sceneCampaign, paginationCampaign] = campaigns;
return {
pageContext: {
@@ -37,10 +48,12 @@ export async function onBeforeRender(pageContext) {
aggActors,
limit,
total,
campaigns: {
index: campaignIndex,
scenes: sceneCampaign,
},
},
campaigns: {
index: campaignIndex,
scope: scopeCampaign,
scenes: scenes.length > 5 && sceneCampaign,
pagination: paginationCampaign,
},
},
};