2022-09-24 16:15:16 -05:00
|
|
|
const { version } = require('../../package.json')
|
|
|
|
|
2022-09-22 18:12:48 -05:00
|
|
|
module.exports.notificationData = {
|
|
|
|
events: [
|
2022-09-24 16:15:16 -05:00
|
|
|
{
|
|
|
|
name: 'onPodcastEpisodeDownloaded',
|
|
|
|
requiresLibrary: true,
|
|
|
|
libraryMediaType: 'podcast',
|
|
|
|
description: 'Triggered when a podcast episode is auto-downloaded',
|
2024-10-12 15:22:21 -05:00
|
|
|
descriptionKey: 'NotificationOnEpisodeDownloadedDescription',
|
2023-02-15 15:57:04 -06:00
|
|
|
variables: ['libraryItemId', 'libraryId', 'podcastTitle', 'podcastAuthor', 'podcastDescription', 'podcastGenres', 'episodeTitle', 'episodeSubtitle', 'episodeDescription', 'libraryName', 'episodeId', 'mediaTags'],
|
2023-02-14 16:51:20 +01:00
|
|
|
defaults: {
|
2022-09-24 16:15:16 -05:00
|
|
|
title: 'New {{podcastTitle}} Episode!',
|
|
|
|
body: '{{episodeTitle}} has been added to {{libraryName}} library.'
|
|
|
|
},
|
|
|
|
testData: {
|
|
|
|
libraryItemId: 'li_notification_test',
|
|
|
|
libraryId: 'lib_test',
|
|
|
|
libraryName: 'Podcasts',
|
2023-02-15 15:57:04 -06:00
|
|
|
mediaTags: 'TestTag1, TestTag2',
|
2022-09-24 16:15:16 -05:00
|
|
|
podcastTitle: 'Abs Test Podcast',
|
2023-02-15 15:57:04 -06:00
|
|
|
podcastAuthor: 'Audiobookshelf',
|
|
|
|
podcastDescription: 'Description of the Abs Test Podcast belongs here.',
|
|
|
|
podcastGenres: 'TestGenre1, TestGenre2',
|
2022-09-24 16:15:16 -05:00
|
|
|
episodeId: 'ep_notification_test',
|
2023-02-15 15:57:04 -06:00
|
|
|
episodeTitle: 'Successful Test Episode',
|
|
|
|
episodeSubtitle: 'Episode Subtitle',
|
|
|
|
episodeDescription: 'Some description of the podcast episode.'
|
2022-09-24 16:15:16 -05:00
|
|
|
}
|
|
|
|
},
|
2024-08-18 14:32:05 -05:00
|
|
|
{
|
|
|
|
name: 'onBackupCompleted',
|
|
|
|
requiresLibrary: false,
|
|
|
|
description: 'Triggered when a backup is completed',
|
2024-10-12 15:22:21 -05:00
|
|
|
descriptionKey: 'NotificationOnBackupCompletedDescription',
|
2024-08-18 14:32:05 -05:00
|
|
|
variables: ['completionTime', 'backupPath', 'backupSize', 'backupCount', 'removedOldest'],
|
|
|
|
defaults: {
|
|
|
|
title: 'Backup Completed',
|
|
|
|
body: 'Backup has been completed successfully.\n\nPath: {{backupPath}}\nSize: {{backupSize}} bytes\nCount: {{backupCount}}\nRemoved Oldest: {{removedOldest}}'
|
|
|
|
},
|
|
|
|
testData: {
|
|
|
|
completionTime: '12:00 AM',
|
|
|
|
backupPath: 'path/to/backup',
|
|
|
|
backupSize: '1.23 MB',
|
|
|
|
backupCount: '1',
|
|
|
|
removedOldest: 'false'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'onBackupFailed',
|
|
|
|
requiresLibrary: false,
|
|
|
|
description: 'Triggered when a backup fails',
|
2024-10-12 15:22:21 -05:00
|
|
|
descriptionKey: 'NotificationOnBackupFailedDescription',
|
2024-08-18 14:32:05 -05:00
|
|
|
variables: ['errorMsg'],
|
|
|
|
defaults: {
|
|
|
|
title: 'Backup Failed',
|
|
|
|
body: 'Backup failed, check ABS logs for more information.\nError message: {{errorMsg}}'
|
|
|
|
},
|
|
|
|
testData: {
|
|
|
|
errorMsg: 'Example error message'
|
|
|
|
}
|
|
|
|
},
|
2025-06-05 13:34:18 +02:00
|
|
|
{
|
|
|
|
name: 'onRSSFeedFailed',
|
|
|
|
requiresLibrary: true,
|
2025-06-09 15:51:14 -05:00
|
|
|
description: 'Triggered when an RSS feed request/update fails, but is not disabled',
|
2025-06-05 13:34:18 +02:00
|
|
|
descriptionKey: 'NotificationOnRSSFeedFailedDescription',
|
|
|
|
variables: ['feedUrl', 'numFailed', 'title'],
|
|
|
|
defaults: {
|
|
|
|
title: 'RSS Feed Update Failed',
|
|
|
|
body: 'Failed to update RSS feed for {{title}}.\nFeed URL: {{feedUrl}}\nNumber of failed attempts: {{numFailed}}'
|
|
|
|
},
|
|
|
|
testData: {
|
|
|
|
title: 'Test RSS Feed',
|
|
|
|
feedUrl: 'https://example.com/rss',
|
|
|
|
numFailed: 3
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'onRSSFeedDisabled',
|
|
|
|
requiresLibrary: true,
|
|
|
|
description: 'Triggered when an RSS feed is disabled due to too many failed attempts',
|
|
|
|
descriptionKey: 'NotificationOnRSSFeedDisabledDescription',
|
|
|
|
variables: ['feedUrl', 'numFailed', 'title'],
|
|
|
|
defaults: {
|
|
|
|
title: 'RSS Feed Disabled',
|
|
|
|
body: 'RSS feed for {{title}} has been disabled due to too many failed updates.\nFeed URL: {{feedUrl}}\nNumber of failed attempts: {{numFailed}}'
|
|
|
|
},
|
|
|
|
testData: {
|
|
|
|
title: 'Test RSS Feed',
|
|
|
|
feedUrl: 'https://example.com/rss',
|
|
|
|
numFailed: 5
|
|
|
|
}
|
|
|
|
},
|
2022-09-22 18:12:48 -05:00
|
|
|
{
|
|
|
|
name: 'onTest',
|
|
|
|
requiresLibrary: false,
|
2022-09-25 09:46:45 -05:00
|
|
|
description: 'Event for testing the notification system',
|
2024-10-12 15:22:21 -05:00
|
|
|
descriptionKey: 'NotificationOnTestDescription',
|
2022-09-24 16:15:16 -05:00
|
|
|
variables: ['version'],
|
2022-09-22 18:12:48 -05:00
|
|
|
defaults: {
|
2022-09-24 16:15:16 -05:00
|
|
|
title: 'Test Notification on Abs {{version}}',
|
|
|
|
body: 'Test notificataion body for abs {{version}}.'
|
|
|
|
},
|
|
|
|
testData: {
|
|
|
|
version: 'v' + version
|
2022-09-22 18:12:48 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2023-02-14 16:51:20 +01:00
|
|
|
}
|