Fixed scene alerts triggering notifications for everything.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user