Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit ad8fb31

Browse files
author
danecreekphotography
authored
Add warning message (#334)
1 parent 398758d commit ad8fb31

4 files changed

Lines changed: 26 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Warnings are now shown when `annotateImage` is `true` for a trigger handler but `enableAnnotations` wasn't set
6+
to `true` in the `settings.json` file. Resolves [issue 333](https://github.com/danecreekphotography/node-deepstackai-trigger/issues/330).
57
- Log messages are printed on startup to help confirm the image folder was mounted correctly with Docker.
68
Resolves [issue 330](https://github.com/danecreekphotography/node-deepstackai-trigger/issues/330).
79
- Web server now shuts down properly when reloading settings. Resolves [issue 323](https://github.com/danecreekphotography/node-deepstackai-trigger/issues/323).

src/handlers/pushbulletManager/PushbulletManager.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ export async function processTrigger(
8080
? LocalStorageManager.mapToLocalStorage(LocalStorageManager.Locations.Annotations, fileName)
8181
: fileName;
8282

83+
// Throw a warning if annotations was requested but it wasn't enabled in settings
84+
if (trigger.pushbulletConfig.annotateImage && !Settings.enableAnnotations) {
85+
log.warn(
86+
"Pushbullet",
87+
`annotateImage is enabled on the trigger however enableAnnotations isn't true in settings.json. Make sure enableAnnotations is set to true to use annotated images.`,
88+
);
89+
}
90+
8391
// Build the Pushbullet message options.
8492
const pushbulletMessage = new PushbulletMessage({
8593
body: caption,

src/handlers/pushoverManager/PushoverManager.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ export async function processTrigger(
6969
? mustacheFormatter.format(trigger.pushoverConfig.caption, fileName, trigger, predictions)
7070
: trigger.name;
7171

72+
// Throw a warning if annotations was requested but it wasn't enabled in settings
73+
if (trigger.pushoverConfig.annotateImage && !Settings.enableAnnotations) {
74+
log.warn(
75+
"Pushover",
76+
`annotateImage is enabled on the trigger however enableAnnotations isn't true in settings.json. Make sure enableAnnotations is set to true to use annotated images.`,
77+
);
78+
}
79+
7280
// Figure out the path to the file to send based on whether
7381
// annotated images were requested in the config.
7482
const imageFileName =

src/handlers/telegramManager/TelegramManager.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ export async function processTrigger(
7070
? mustacheFormatter.format(trigger.telegramConfig.caption, fileName, trigger, predictions)
7171
: trigger.name;
7272

73+
// Throw a warning if annotations was requested but it wasn't enabled in settings
74+
if (trigger.telegramConfig.annotateImage && !Settings.enableAnnotations) {
75+
log.warn(
76+
"Telegram",
77+
`annotateImage is enabled on the trigger however enableAnnotations isn't true in settings.json. Make sure enableAnnotations is set to true to use annotated images.`,
78+
);
79+
}
80+
7381
// Figure out the path to the file to send based on whether
7482
// annotated images were requested in the config.
7583
const imageFileName =

0 commit comments

Comments
 (0)