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", "name": "traxxx-web",
"version": "0.41.6", "version": "0.41.5",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "0.41.6", "version": "0.41.5",
"dependencies": { "dependencies": {
"@brillout/json-serializer": "^0.5.8", "@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5", "@dicebear/collection": "^7.0.5",

View File

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

View File

@ -6,7 +6,6 @@ import { fetchMovies } from '#/src/movies.js';
import { curateScenesQuery } from '#/src/web/scenes.js'; import { curateScenesQuery } from '#/src/web/scenes.js';
import { curateMoviesQuery } from '#/src/web/movies.js'; import { curateMoviesQuery } from '#/src/web/movies.js';
import { fetchCountries } from '#/src/countries.js'; import { fetchCountries } from '#/src/countries.js';
import { getRandomCampaigns, getCampaignIndex } from '#/src/campaigns.js';
async function fetchReleases(pageContext) { async function fetchReleases(pageContext) {
if (pageContext.routeParams.domain === 'movies') { if (pageContext.routeParams.domain === 'movies') {
@ -41,27 +40,16 @@ export async function onBeforeRender(pageContext) {
throw redirect(`/login?r=${encodeURIComponent(pageContext.urlOriginal)}`); 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) { if (!actor) {
throw render(404, `Cannot find actor '${pageContext.routeParams.actorId}'.`); 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 { return {
pageContext: { pageContext: {
title: isEditing title: isEditing
@ -72,11 +60,6 @@ export async function onBeforeRender(pageContext) {
countries, countries,
...actorReleases, ...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), fetchTagsById([tagSlug], {}, pageContext.user),
fetchReleases(pageContext), fetchReleases(pageContext),
getRandomCampaigns([ getRandomCampaigns([
{ tagSlugs: [tagSlug], minRatio: 3 }, { tagSlugs: [tagSlug], minRatio: 1.5 },
{ tagSlugs: [tagSlug], minRatio: 3 }, { tagSlugs: [tagSlug], minRatio: 1.5 },
pageContext.routeParams.domain === 'scenes' pageContext.routeParams.domain === 'scenes'
? { tagSlugs: [tagSlug], minRatio: 0.75, maxRatio: 1.25 } ? { tagSlugs: [tagSlug], minRatio: 0.75, maxRatio: 1.25 }
: null, : null,