Excluding BTS scene tags from actor-specific tag filter.

This commit is contained in:
2026-11-23 00:41:33 +01:00
parent 116192582c
commit 54afdb156a
2 changed files with 21 additions and 6 deletions
+6 -4
View File
@@ -122,7 +122,7 @@ export async function syncManticoreScenes(sceneIds) {
COUNT(DISTINCT local_actors.id) FILTER (WHERE COALESCE(actors.gender, local_actors.gender) = 'male') as male_count,
COUNT(DISTINCT local_actors.id) FILTER (WHERE COALESCE(actors.gender, local_actors.gender) = 'transsexual') as trans_count,
COUNT(DISTINCT local_actors.id) FILTER (WHERE local_actors.actor_id IS NULL) as unidentified_count,
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name, tags.priority, tags_aliases.name, local_tags.actor_id)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags,
COALESCE(JSON_AGG(DISTINCT (tags.id, tags.name, tags.priority, tags_aliases.name, local_tags.actor_id, tags.slug)) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags,
COALESCE(JSON_AGG(DISTINCT (movies.id, movies.title)) FILTER (WHERE movies.id IS NOT NULL), '[]') as movies,
COALESCE(JSON_AGG(DISTINCT (series.id, series.title)) FILTER (WHERE series.id IS NOT NULL), '[]') as series,
studios.showcased IS NOT false
@@ -195,7 +195,9 @@ export async function syncManticoreScenes(sceneIds) {
const flatTags = scene.tags.filter((tag) => tag.f3 > 6).flatMap((tag) => [tag.f2].concat(tag.f4)).filter(Boolean); // only make top tags searchable to minimize cluttered results
const filteredTitle = filterTitle(scene.title, [...flatActors, ...flatTags]);
const isCompilation = scene.tags.some((tag) => tag.f2 === 'compilation');
// tag slugs, f6 = tag slug
const nonSceneTags = ['compilation', 'bts'];
const isNonScene = scene.tags.some((tag) => nonSceneTags.includes(tag.f6));
// use decimal packing with 5-decimal pad to allow for actor-specific tags, i.e. actor 135 tag 5 = 13500005
// all global tags are necessarily < 10,000, all tags for actor 135 are >= 13500000 and <= 13599999
@@ -206,8 +208,8 @@ export async function syncManticoreScenes(sceneIds) {
return tag.f5 * 1_000_00 + tag.f1;
}
if (isCompilation && tag.f2 !== 'compilation') {
// tag is part of a compilation, pack with arbitrary large number that will never be an actor ID (famous last words)
if (isNonScene && !nonSceneTags.includes(tag.f6)) {
// tag is part of a compilation or BTS, pack with arbitrary large number that will never be an actor ID (famous last words)
return 900_000_000 * 1_000_00 + tag.f1;
}