Applying global vs actor tag toggle to scene results.

This commit is contained in:
2026-07-03 03:18:33 +02:00
parent e04ddaed9b
commit cb91cd4cc7
4 changed files with 17 additions and 1 deletions

View File

@@ -498,7 +498,17 @@ async function queryManticoreSql(filters, options, _reqUser) {
}
filters.tagIds?.forEach((tagId) => {
builder.where('any(tag_ids)', tagId);
if (filters.onlyActorTags) {
builder.where((whereBuilder) => {
whereBuilder.where('any(assigned_tag_ids)', tagId);
filters.actorIds?.forEach((actorId) => {
whereBuilder.orWhere('any(assigned_tag_ids)', actorId * 1_000_00 + tagId);
});
});
} else {
builder.where('any(tag_ids)', tagId);
}
});
if (filters.notTagIds) {

View File

@@ -44,6 +44,7 @@ export async function curateScenesQuery(query) {
notActorIds: splitActors.filter((actor) => actor.charAt(0) === '!').map((identifier) => parseActorIdentifier(identifier.slice(1))?.id).filter(Boolean),
tagIds,
notTagIds: notTagIds.filter((tagId) => !tagIds.includes(tagId)), // included tags get priority over excluded tags
onlyActorTags: !!query.at,
entityId,
notEntityIds,
movieId: Number(query.movieId) || null,