Compare commits

..

No commits in common. "ebc2895d7e79ead7718fdb42602de91cadfda91d" and "2afcdd605042d9a8faeb82fcfb0b12576403bc3a" have entirely different histories.

4 changed files with 10 additions and 27 deletions

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "traxxx-web",
"version": "0.41.6",
"version": "0.41.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.41.6",
"version": "0.41.5",
"dependencies": {
"@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5",

View File

@ -87,7 +87,7 @@
"overrides": {
"vite": "$vite"
},
"version": "0.41.6",
"version": "0.41.5",
"imports": {
"#/*": "./*.js"
}

View File

@ -6,7 +6,6 @@ import { fetchMovies } from '#/src/movies.js';
import { curateScenesQuery } from '#/src/web/scenes.js';
import { curateMoviesQuery } from '#/src/web/movies.js';
import { fetchCountries } from '#/src/countries.js';
import { getRandomCampaigns, getCampaignIndex } from '#/src/campaigns.js';
async function fetchReleases(pageContext) {
if (pageContext.routeParams.domain === 'movies') {
@ -41,27 +40,16 @@ export async function onBeforeRender(pageContext) {
throw redirect(`/login?r=${encodeURIComponent(pageContext.urlOriginal)}`);
}
const [actor] = await fetchActorsById([Number(pageContext.routeParams.actorId)], {}, pageContext.user);
const [[actor], actorReleases, countries] = await Promise.all([
fetchActorsById([Number(pageContext.routeParams.actorId)], {}, pageContext.user),
fetchReleases(pageContext),
isEditing && fetchCountries(),
]);
if (!actor) {
throw render(404, `Cannot find actor '${pageContext.routeParams.actorId}'.`);
}
const [actorReleases, campaigns, countries] = await Promise.all([
fetchReleases(pageContext),
getRandomCampaigns([
// don't show meta campaign, too intrusive under actor bio
{ minRatio: 3 },
pageContext.routeParams.domain === 'scenes'
? { minRatio: 0.75, maxRatio: 1.25 }
: null,
].filter(Boolean), { tagFilter: pageContext.tagFilter }),
isEditing && fetchCountries(),
]);
const campaignIndex = getCampaignIndex(actorReleases.limit);
const [paginationCampaign, sceneCampaign] = campaigns;
return {
pageContext: {
title: isEditing
@ -72,11 +60,6 @@ export async function onBeforeRender(pageContext) {
countries,
...actorReleases,
},
campaigns: {
index: campaignIndex,
scenes: actorReleases.limit > 5 && sceneCampaign,
pagination: paginationCampaign,
},
},
};
}

View File

@ -43,8 +43,8 @@ export async function onBeforeRender(pageContext) {
fetchTagsById([tagSlug], {}, pageContext.user),
fetchReleases(pageContext),
getRandomCampaigns([
{ tagSlugs: [tagSlug], minRatio: 3 },
{ tagSlugs: [tagSlug], minRatio: 3 },
{ tagSlugs: [tagSlug], minRatio: 1.5 },
{ tagSlugs: [tagSlug], minRatio: 1.5 },
pageContext.routeParams.domain === 'scenes'
? { tagSlugs: [tagSlug], minRatio: 0.75, maxRatio: 1.25 }
: null,