Determining location with restrictions disabled, cleaned up.

This commit is contained in:
2026-07-23 05:34:28 +02:00
parent 4c48700086
commit 77b27a56f7
28 changed files with 590 additions and 71 deletions

View File

@@ -191,4 +191,8 @@ onMounted(() => {
font-weight: bold;
text-align: center;
}
.button-submit {
padding: .75rem 1rem;
}
</style>

View File

@@ -221,6 +221,7 @@ onMounted(() => {
}
.button-submit {
padding: .75rem 1rem;
margin-top: .5rem;
}

View File

@@ -4,7 +4,7 @@ export async function onBeforeRender(pageContext) {
const networks = await fetchEntities(pageContext.urlParsed.search.q
? { query: pageContext.urlParsed.search.q }
: { type: 'primary' }, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
});
return {

View File

@@ -21,7 +21,7 @@ async function fetchReleases(pageContext, entityId) {
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: true,
}, pageContext.user, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
});
}
@@ -35,7 +35,7 @@ async function fetchReleases(pageContext, entityId) {
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: true,
}, pageContext.user, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
});
}
@@ -52,7 +52,7 @@ export async function onBeforeRender(pageContext) {
entityReleases,
] = await Promise.all([
fetchEntitiesById([Number(entityId)], { includeChildren: true }, pageContext.user, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
}),
fetchReleases(pageContext, entityId),
]);

View File

@@ -10,7 +10,7 @@ export async function onBeforeRender(pageContext) {
limit: Number(pageContext.urlParsed.search.limit) || 50,
dedupe: true,
}, pageContext.user, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
});
return {

View File

@@ -18,7 +18,7 @@ function getTitle(movie) {
export async function onBeforeRender(pageContext) {
const [[movie], movieScenes] = await Promise.all([
fetchMoviesById([Number(pageContext.routeParams.movieId)], pageContext.user, { restriction: pageContext.restriction }),
fetchMoviesById([Number(pageContext.routeParams.movieId)], pageContext.user, { restriction: pageContext.geo.restriction }),
fetchScenes(await curateScenesQuery({
...pageContext.urlQuery,
scope: 'oldest',
@@ -28,7 +28,7 @@ export async function onBeforeRender(pageContext) {
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: true,
}, pageContext.user, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
}),
]);

View File

@@ -18,7 +18,7 @@ export async function onBeforeRender(pageContext) {
aggregate: true,
dedupe: true,
}, pageContext.user, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
}),
getRandomCampaigns([
{ minRatio: 0.75, maxRatio: 1.25 },

View File

@@ -25,7 +25,7 @@ export async function onBeforeRender(pageContext) {
includeAssets: true,
includePartOf: true,
actorStashes: true,
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
});
if (!scene) {

View File

@@ -16,24 +16,24 @@ export async function onBeforeRender(pageContext) {
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 15,
}, pageContext.user, { restriction: pageContext.restriction }),
}, pageContext.user, { restriction: pageContext.geo.restriction }),
fetchActors(curateActorsQuery(pageContext.urlQuery), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 10,
order: ['results', 'desc'],
}, pageContext.user, { restriction: pageContext.restriction }),
}, pageContext.user, { restriction: pageContext.geo.restriction }),
fetchMovies(await curateMoviesQuery({
...pageContext.urlQuery,
scope: pageContext.routeParams.scope || 'results',
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 5,
}, pageContext.user, { restriction: pageContext.restriction }),
}, pageContext.user, { restriction: pageContext.geo.restriction }),
fetchEntities({
query: pageContext.urlParsed.search.q,
limit: 5,
}, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
}),
]);

View File

@@ -118,7 +118,7 @@ const tagSlugs = {
};
async function searchTags(pageContext) {
const tags = await fetchTags({ query: pageContext.urlParsed.search.q }, { restriction: pageContext.restriction });
const tags = await fetchTags({ query: pageContext.urlParsed.search.q }, { restriction: pageContext.geo.restriction });
return {
pageContext: {
@@ -137,13 +137,13 @@ export async function onBeforeRender(pageContext) {
return searchTags(pageContext);
}
const tags = await fetchTagsById(Object.values(tagSlugs).flat(), {}, pageContext.user, { restriction: pageContext.restriction });
const tags = await fetchTagsById(Object.values(tagSlugs).flat(), {}, pageContext.user, { restriction: pageContext.geo.restriction });
const filteredTags = tags.filter((tag) => !pageContext.tagFilter.includes(tag.name) && !pageContext.tagFilter.includes(tag.slug));
const tagsBySlug = Object.fromEntries(filteredTags.map((tag) => [tag.slug, tag]));
const tagShowcase = Object.fromEntries(Object.entries(tagSlugs).map(([category, categorySlugs]) => [
censor(category, pageContext.restriction),
censor(category, pageContext.geo.restriction),
categorySlugs.map((slug) => tagsBySlug[slug]).filter(Boolean),
]));

View File

@@ -23,7 +23,7 @@ async function fetchReleases(pageContext) {
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: true,
}, pageContext.user, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
});
}
@@ -37,13 +37,13 @@ async function fetchReleases(pageContext) {
limit: Number(pageContext.urlParsed.search.limit) || 30,
aggregate: true,
}, pageContext.user, {
restriction: pageContext.restriction,
restriction: pageContext.geo.restriction,
});
}
export async function onBeforeRender(pageContext) {
const tagSlug = pageContext.routeParams.tagSlug;
const [tag] = await fetchTagsById([tagSlug], {}, pageContext.user, { restriction: pageContext.restriction });
const [tag] = await fetchTagsById([tagSlug], {}, pageContext.user, { restriction: pageContext.geo.restriction });
if (tag.aliasFor) {
throw redirect(`/tag/${tag.aliasFor}`);

View File

@@ -19,7 +19,7 @@ export async function onBeforeRender(pageContext) {
limit: Number(pageContext.urlParsed.search.limit) || 29,
aggregate: withQuery,
dedupe: true,
}, pageContext.user, { restriction: pageContext.restriction }),
}, pageContext.user, { restriction: pageContext.geo.restriction }),
getRandomCampaigns([
{ minRatio: 2.0, maxRatio: 5 },
{ minRatio: 0.75, maxRatio: 1.25 },