mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-07 07:55:03 +02:00
Add:Notification system max queue and max failed attempts settings #996
This commit is contained in:
parent
7aa89f16c9
commit
39a13e3610
2 changed files with 68 additions and 14 deletions
|
@ -1,5 +1,6 @@
|
|||
const Logger = require('../../Logger')
|
||||
const Notification = require('../Notification')
|
||||
const { isNullOrNaN } = require('../../utils')
|
||||
|
||||
class NotificationSettings {
|
||||
constructor(settings = null) {
|
||||
|
@ -59,11 +60,26 @@ class NotificationSettings {
|
|||
|
||||
update(payload) {
|
||||
if (!payload) return false
|
||||
|
||||
var hasUpdates = false
|
||||
if (payload.appriseApiUrl !== this.appriseApiUrl) {
|
||||
this.appriseApiUrl = payload.appriseApiUrl || null
|
||||
return true
|
||||
hasUpdates = true
|
||||
}
|
||||
return false
|
||||
|
||||
const _maxFailedAttempts = isNullOrNaN(payload.maxFailedAttempts) ? 5 : Number(payload.maxFailedAttempts)
|
||||
if (_maxFailedAttempts !== this.maxFailedAttempts) {
|
||||
this.maxFailedAttempts = _maxFailedAttempts
|
||||
hasUpdates = true
|
||||
}
|
||||
|
||||
const _maxNotificationQueue = isNullOrNaN(payload.maxNotificationQueue) ? 20 : Number(payload.maxNotificationQueue)
|
||||
if (_maxNotificationQueue !== this.maxNotificationQueue) {
|
||||
this.maxNotificationQueue = _maxNotificationQueue
|
||||
hasUpdates = true
|
||||
}
|
||||
|
||||
return hasUpdates
|
||||
}
|
||||
|
||||
createNotification(payload) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue