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) {