Applying global vs actor tag toggle to scene results.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user