Compare commits
2 Commits
2afcdd6050
...
ebc2895d7e
| Author | SHA1 | Date |
|---|---|---|
|
|
ebc2895d7e | |
|
|
45ed3be747 |
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "traxxx-web",
|
||||
"version": "0.41.5",
|
||||
"version": "0.41.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "0.41.5",
|
||||
"version": "0.41.6",
|
||||
"dependencies": {
|
||||
"@brillout/json-serializer": "^0.5.8",
|
||||
"@dicebear/collection": "^7.0.5",
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
"overrides": {
|
||||
"vite": "$vite"
|
||||
},
|
||||
"version": "0.41.5",
|
||||
"version": "0.41.6",
|
||||
"imports": {
|
||||
"#/*": "./*.js"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ 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') {
|
||||
|
|
@ -40,16 +41,27 @@ export async function onBeforeRender(pageContext) {
|
|||
throw redirect(`/login?r=${encodeURIComponent(pageContext.urlOriginal)}`);
|
||||
}
|
||||
|
||||
const [[actor], actorReleases, countries] = await Promise.all([
|
||||
fetchActorsById([Number(pageContext.routeParams.actorId)], {}, pageContext.user),
|
||||
fetchReleases(pageContext),
|
||||
isEditing && fetchCountries(),
|
||||
]);
|
||||
const [actor] = await fetchActorsById([Number(pageContext.routeParams.actorId)], {}, pageContext.user);
|
||||
|
||||
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
|
||||
|
|
@ -60,6 +72,11 @@ export async function onBeforeRender(pageContext) {
|
|||
countries,
|
||||
...actorReleases,
|
||||
},
|
||||
campaigns: {
|
||||
index: campaignIndex,
|
||||
scenes: actorReleases.limit > 5 && sceneCampaign,
|
||||
pagination: paginationCampaign,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ export async function onBeforeRender(pageContext) {
|
|||
fetchTagsById([tagSlug], {}, pageContext.user),
|
||||
fetchReleases(pageContext),
|
||||
getRandomCampaigns([
|
||||
{ tagSlugs: [tagSlug], minRatio: 1.5 },
|
||||
{ tagSlugs: [tagSlug], minRatio: 1.5 },
|
||||
{ tagSlugs: [tagSlug], minRatio: 3 },
|
||||
{ tagSlugs: [tagSlug], minRatio: 3 },
|
||||
pageContext.routeParams.domain === 'scenes'
|
||||
? { tagSlugs: [tagSlug], minRatio: 0.75, maxRatio: 1.25 }
|
||||
: null,
|
||||
|
|
|
|||
Loading…
Reference in New Issue