Fixed showcase in stash. Applying tag filter to tag list.
This commit is contained in:
parent
5525284818
commit
0b37d2dd1a
|
@ -14,6 +14,7 @@ export async function onBeforeRender(pageContext) {
|
||||||
scope: pageContext.routeParams.scope || 'stashed',
|
scope: pageContext.routeParams.scope || 'stashed',
|
||||||
stashId: stash.id,
|
stashId: stash.id,
|
||||||
tagFilter: pageContext.tagFilter,
|
tagFilter: pageContext.tagFilter,
|
||||||
|
isShowcased: null,
|
||||||
}), {
|
}), {
|
||||||
page: Number(pageContext.routeParams.page) || 1,
|
page: Number(pageContext.routeParams.page) || 1,
|
||||||
limit: Number(pageContext.urlParsed.search.limit) || 30,
|
limit: Number(pageContext.urlParsed.search.limit) || 30,
|
||||||
|
|
|
@ -116,9 +116,10 @@ const tagSlugs = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function onBeforeRender(_pageContext) {
|
export async function onBeforeRender(pageContext) {
|
||||||
const tags = await fetchTagsById(Object.values(tagSlugs).flat());
|
const tags = await fetchTagsById(Object.values(tagSlugs).flat());
|
||||||
const tagsBySlug = Object.fromEntries(tags.map((tag) => [tag.slug, tag]));
|
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]) => [
|
const tagShowcase = Object.fromEntries(Object.entries(tagSlugs).map(([category, categorySlugs]) => [
|
||||||
category,
|
category,
|
||||||
|
|
|
@ -472,7 +472,7 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof filters.isShowcased === 'boolean') {
|
if (typeof filters.isShowcased === 'boolean') {
|
||||||
builder.where('is_showcased', filters.isShowcased);
|
builder.where('scenes.is_showcased', filters.isShowcased);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filters.scope || filters.scope === 'latest') {
|
if (!filters.scope || filters.scope === 'latest') {
|
||||||
|
|
|
@ -35,7 +35,7 @@ export async function curateScenesQuery(query) {
|
||||||
notEntityIds,
|
notEntityIds,
|
||||||
movieId: Number(query.movieId) || null,
|
movieId: Number(query.movieId) || null,
|
||||||
stashId: Number(query.stashId) || null,
|
stashId: Number(query.stashId) || null,
|
||||||
isShowcased: query.isShowcased ?? true,
|
isShowcased: typeof query.isShowcased === 'boolean' ? query.isShowcased : null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue