Fixed showcase in stash. Applying tag filter to tag list.

This commit is contained in:
DebaucheryLibrarian 2024-04-03 03:31:35 +02:00
parent 5525284818
commit 0b37d2dd1a
4 changed files with 6 additions and 4 deletions

View File

@ -14,6 +14,7 @@ export async function onBeforeRender(pageContext) {
scope: pageContext.routeParams.scope || 'stashed',
stashId: stash.id,
tagFilter: pageContext.tagFilter,
isShowcased: null,
}), {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 30,

View File

@ -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 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]) => [
category,

View File

@ -472,7 +472,7 @@ async function queryManticoreSql(filters, options, _reqUser) {
}
if (typeof filters.isShowcased === 'boolean') {
builder.where('is_showcased', filters.isShowcased);
builder.where('scenes.is_showcased', filters.isShowcased);
}
if (!filters.scope || filters.scope === 'latest') {

View File

@ -35,7 +35,7 @@ export async function curateScenesQuery(query) {
notEntityIds,
movieId: Number(query.movieId) || null,
stashId: Number(query.stashId) || null,
isShowcased: query.isShowcased ?? true,
isShowcased: typeof query.isShowcased === 'boolean' ? query.isShowcased : null,
};
}