mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 04:11:43 +00:00
Add: failed backup notification
This commit is contained in:
parent
37cf019e99
commit
d6b5363ab9
2 changed files with 23 additions and 0 deletions
|
|
@ -50,6 +50,16 @@ class NotificationManager {
|
||||||
this.triggerNotification('onBackupCompleted', eventData)
|
this.triggerNotification('onBackupCompleted', eventData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async onBackupFailed(errorMsg) {
|
||||||
|
if (!Database.notificationSettings.isUseable) return
|
||||||
|
|
||||||
|
Logger.debug(`[NotificationManager] onBackupFailed: Backup failed`)
|
||||||
|
const eventData = {
|
||||||
|
errorMsg: errorMsg || 'Backup failed'
|
||||||
|
}
|
||||||
|
this.triggerNotification('onBackupFailed', eventData)
|
||||||
|
}
|
||||||
|
|
||||||
onTest() {
|
onTest() {
|
||||||
this.triggerNotification('onTest')
|
this.triggerNotification('onTest')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,19 @@ module.exports.notificationData = {
|
||||||
removedOldest: 'false'
|
removedOldest: 'false'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'onBackupFailed',
|
||||||
|
requiresLibrary: false,
|
||||||
|
description: 'Triggered when a backup fails',
|
||||||
|
variables: ['errorMsg'],
|
||||||
|
defaults: {
|
||||||
|
title: 'Backup Failed',
|
||||||
|
body: 'Backup failed, check ABS logs for more information.\nError message: {{errorMsg}}'
|
||||||
|
},
|
||||||
|
testData: {
|
||||||
|
errorMsg: 'Example error message'
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'onTest',
|
name: 'onTest',
|
||||||
requiresLibrary: false,
|
requiresLibrary: false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue