Fix notification js docs and update description/defaults

This commit is contained in:
advplyr 2025-06-09 16:21:05 -05:00
parent 7122756e58
commit 5e2bb0b12c
3 changed files with 20 additions and 20 deletions

View File

@ -918,8 +918,8 @@
"NotificationOnBackupCompletedDescription": "Triggered when a backup is completed", "NotificationOnBackupCompletedDescription": "Triggered when a backup is completed",
"NotificationOnBackupFailedDescription": "Triggered when a backup fails", "NotificationOnBackupFailedDescription": "Triggered when a backup fails",
"NotificationOnEpisodeDownloadedDescription": "Triggered when a podcast episode is auto-downloaded", "NotificationOnEpisodeDownloadedDescription": "Triggered when a podcast episode is auto-downloaded",
"NotificationOnRSSFeedDisabledDescription": "Triggered when an RSS feed is disabled due to too many failed attempts", "NotificationOnRSSFeedDisabledDescription": "Triggered when automatic episode downloads are disabled due to too many failed attempts",
"NotificationOnRSSFeedFailedDescription": "Triggered when an RSS feed request/update fails, but is not disabled", "NotificationOnRSSFeedFailedDescription": "Triggered when the RSS feed request fails for an automatic episode download",
"NotificationOnTestDescription": "Event for testing the notification system", "NotificationOnTestDescription": "Event for testing the notification system",
"PlaceholderNewCollection": "New collection name", "PlaceholderNewCollection": "New collection name",
"PlaceholderNewFolderPath": "New folder path", "PlaceholderNewFolderPath": "New folder path",

View File

@ -72,11 +72,11 @@ class NotificationManager {
} }
/** /**
* Handles RSS feed updates * Handles scheduled episode download RSS feed request failed
* @param feedUrl *
* @param numFailed * @param {string} feedUrl
* @param title * @param {number} numFailed
* @returns {Promise<void>} * @param {string} title
*/ */
async onRSSFeedFailed(feedUrl, numFailed, title) { async onRSSFeedFailed(feedUrl, numFailed, title) {
if (!Database.notificationSettings.isUseable) return if (!Database.notificationSettings.isUseable) return
@ -86,7 +86,7 @@ class NotificationManager {
return return
} }
Logger.debug(`[NotificationManager] onRSSFeedFailed: RSS feed update failed for ${feedUrl}`) Logger.debug(`[NotificationManager] onRSSFeedFailed: RSS feed request failed for ${feedUrl}`)
const eventData = { const eventData = {
feedUrl: feedUrl, feedUrl: feedUrl,
numFailed: numFailed || 0, numFailed: numFailed || 0,
@ -96,11 +96,11 @@ class NotificationManager {
} }
/** /**
* Handles RSS feed being disabled due to too many failed updates * Handles scheduled episode downloads disabled due to too many failed attempts
* @param feedUrl *
* @param numFailed * @param {string} feedUrl
* @param title * @param {number} numFailed
* @returns {Promise<void>} * @param {string} title
*/ */
async onRSSFeedDisabled(feedUrl, numFailed, title) { async onRSSFeedDisabled(feedUrl, numFailed, title) {
if (!Database.notificationSettings.isUseable) return if (!Database.notificationSettings.isUseable) return
@ -110,7 +110,7 @@ class NotificationManager {
return return
} }
Logger.debug(`[NotificationManager] onRSSFeedDisabled: RSS feed disabled due to ${numFailed} failed updates for ${feedUrl}`) Logger.debug(`[NotificationManager] onRSSFeedDisabled: Podcast scheduled episode download disabled due to ${numFailed} failed requests for ${feedUrl}`)
const eventData = { const eventData = {
feedUrl: feedUrl, feedUrl: feedUrl,
numFailed: numFailed || 0, numFailed: numFailed || 0,

View File

@ -63,12 +63,12 @@ module.exports.notificationData = {
{ {
name: 'onRSSFeedFailed', name: 'onRSSFeedFailed',
requiresLibrary: true, requiresLibrary: true,
description: 'Triggered when an RSS feed request/update fails, but is not disabled', description: 'Triggered when the RSS feed request fails for an automatic episode download',
descriptionKey: 'NotificationOnRSSFeedFailedDescription', descriptionKey: 'NotificationOnRSSFeedFailedDescription',
variables: ['feedUrl', 'numFailed', 'title'], variables: ['feedUrl', 'numFailed', 'title'],
defaults: { defaults: {
title: 'RSS Feed Update Failed', title: 'RSS Feed Request Failed',
body: 'Failed to update RSS feed for {{title}}.\nFeed URL: {{feedUrl}}\nNumber of failed attempts: {{numFailed}}' body: 'Failed to request RSS feed for {{title}}.\nFeed URL: {{feedUrl}}\nNumber of failed attempts: {{numFailed}}'
}, },
testData: { testData: {
title: 'Test RSS Feed', title: 'Test RSS Feed',
@ -79,12 +79,12 @@ module.exports.notificationData = {
{ {
name: 'onRSSFeedDisabled', name: 'onRSSFeedDisabled',
requiresLibrary: true, requiresLibrary: true,
description: 'Triggered when an RSS feed is disabled due to too many failed attempts', description: 'Triggered when automatic episode downloads are disabled due to too many failed attempts',
descriptionKey: 'NotificationOnRSSFeedDisabledDescription', descriptionKey: 'NotificationOnRSSFeedDisabledDescription',
variables: ['feedUrl', 'numFailed', 'title'], variables: ['feedUrl', 'numFailed', 'title'],
defaults: { defaults: {
title: 'RSS Feed Disabled', title: 'Podcast Episode Download Schedule Disabled',
body: 'RSS feed for {{title}} has been disabled due to too many failed updates.\nFeed URL: {{feedUrl}}\nNumber of failed attempts: {{numFailed}}' body: 'Automatic episode downloads for {{title}} have been disabled due to too many failed RSS feed requests.\nFeed URL: {{feedUrl}}\nNumber of failed attempts: {{numFailed}}'
}, },
testData: { testData: {
title: 'Test RSS Feed', title: 'Test RSS Feed',