Fixed scene alerts triggering notifications for everything.

This commit is contained in:
DebaucheryLibrarian
2026-07-15 17:27:12 +02:00
parent b34dd33b5c
commit 162fcc49c6
3 changed files with 56 additions and 245 deletions

View File

@@ -160,6 +160,14 @@ async function notify(scenes) {
const triggers = alerts.flatMap((alert) => {
const alertScenes = curatedScenes.filter((scene) => {
if (alert.all) {
if (alert.actors.length === 0
&& alert.tags.length === 0
&& alert.entities.length === 0
&& alert.matches.length === 0) {
// we must match on *something*, this is likely a release date alert handled separately
return false;
}
if (alert.actors.length > 0 && !alert.actors[alert.allActors ? 'every' : 'some']((actorId) => scene.actorIds.includes(actorId))) {
return false;
}

View File

@@ -503,6 +503,7 @@ async function storeScenes(releases, useBatchId) {
logger.info(`Stored ${storedReleaseEntries.length}, updated ${updated} releases`);
// TODO: disable, handled by web sync now
await notify(releasesWithId);
return releasesWithId;