Fixed search inputs not working in Firefox/Safari. Added Stashes and Alerts to header menu. Indexing compilation tags as assigned tags in Manticore.

This commit is contained in:
2026-07-06 01:36:30 +02:00
parent 6f8d3b1ad2
commit ee1e347405
10 changed files with 143 additions and 20 deletions

View File

@@ -717,6 +717,12 @@ export async function mergeActors(targetActorId, sourceActorIds, reqUser) {
.whereIn('actor_id', sourceActorIds)
.returning('stash_id');
/* TODO: add revision entries
console.log('SOURCES', targetActor, sourceActors);
throw new Error('ABORT');
*/
await trx.commit();
} catch (error) {
await trx.rollback();

View File

@@ -187,13 +187,28 @@ 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');
// 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
// f1 = tag ID, f5 = actor ID
const assignedTagIds = scene.tags.map((tag) => (tag.f5 === null ? tag.f1 : tag.f5 * 1_000_00 + tag.f1));
const assignedTagIds = scene.tags.map((tag) => {
if (tag.f5) {
// tag is assigned to actor, pack tag ID with actor ID
return tag.f5 * 1_000_00 + tag.f1;
}
/*
if (sceneId === '187734') {
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)
return 900_000_000 * 1_000_00 + tag.f1;
}
// plain tag ID
return tag.f1;
});
/* abort to inspect
if (sceneId === '554480') {
console.log(scene, assignedTagIds);
throw new Error('ABORT');
}