From 2a4b0e96366ffb3f727950edc131c86414321140 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 5 Jun 2024 03:11:49 +0200 Subject: [PATCH] Disable notifications if showcase flag is disabled. --- src/alerts.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/alerts.js b/src/alerts.js index a44cd5fa..57854385 100755 --- a/src/alerts.js +++ b/src/alerts.js @@ -2,6 +2,8 @@ const escapeRegexp = require('escape-string-regexp'); +const argv = require('./argv'); +const logger = require('./logger')(__filename); const knex = require('./knex'); const { indexApi } = require('./manticore'); const bulkInsert = require('./utils/bulk-insert'); @@ -63,6 +65,11 @@ async function removeAlert(alertId) { } async function notify(scenes) { + if (argv.showcased === false) { + logger.info(`Skipping notify for ${scenes.length} scenes because showcase flag is disabled.`); + return []; + } + const sceneIds = scenes.map((scene) => scene.id); const [