mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-09 04:02:42 +02:00
Update:Notification system descriptions #996
This commit is contained in:
@@ -37,7 +37,7 @@ class NotificationManager {
|
||||
async triggerNotification(eventName, eventData, intentionallyFail = false) {
|
||||
if (!this.db.notificationSettings.isUseable) return false
|
||||
|
||||
const notifications = this.db.notificationSettings.getNotificationsForEvent(eventName)
|
||||
const notifications = this.db.notificationSettings.getActiveNotificationsForEvent(eventName)
|
||||
for (const notification of notifications) {
|
||||
Logger.debug(`[NotificationManager] triggerNotification: Sending ${eventName} notification ${notification.id}`)
|
||||
const success = intentionallyFail ? false : await this.sendNotification(notification, eventData)
|
||||
|
||||
@@ -32,8 +32,8 @@ class NotificationSettings {
|
||||
return !!this.appriseApiUrl
|
||||
}
|
||||
|
||||
getNotificationsForEvent(eventName) {
|
||||
return this.notifications.filter(n => n.eventName === eventName)
|
||||
getActiveNotificationsForEvent(eventName) {
|
||||
return this.notifications.filter(n => n.eventName === eventName && n.enabled)
|
||||
}
|
||||
|
||||
getNotification(id) {
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports.notificationData = {
|
||||
{
|
||||
name: 'onTest',
|
||||
requiresLibrary: false,
|
||||
description: 'Notification for testing',
|
||||
description: 'Event for testing the notification system',
|
||||
variables: ['version'],
|
||||
defaults: {
|
||||
title: 'Test Notification on Abs {{version}}',
|
||||
|
||||
Reference in New Issue
Block a user