mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-09 10:51:37 +00:00
Compare commits
No commits in common. "6968a5c02aea5076ae7efcc20354328b7a701da9" and "8ecc912c2db108d34f7e2a4158fdfdda0c78944f" have entirely different histories.
6968a5c02a
...
8ecc912c2d
4 changed files with 0 additions and 84 deletions
|
|
@ -918,8 +918,6 @@
|
||||||
"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 automatic episode downloads are disabled due to too many failed attempts",
|
|
||||||
"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",
|
||||||
|
|
|
||||||
|
|
@ -71,54 +71,6 @@ class NotificationManager {
|
||||||
this.triggerNotification('onBackupCompleted', eventData)
|
this.triggerNotification('onBackupCompleted', eventData)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles scheduled episode download RSS feed request failed
|
|
||||||
*
|
|
||||||
* @param {string} feedUrl
|
|
||||||
* @param {number} numFailed
|
|
||||||
* @param {string} title
|
|
||||||
*/
|
|
||||||
async onRSSFeedFailed(feedUrl, numFailed, title) {
|
|
||||||
if (!Database.notificationSettings.isUseable) return
|
|
||||||
|
|
||||||
if (!Database.notificationSettings.getHasActiveNotificationsForEvent('onRSSFeedFailed')) {
|
|
||||||
Logger.debug(`[NotificationManager] onRSSFeedFailed: No active notifications`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.debug(`[NotificationManager] onRSSFeedFailed: RSS feed request failed for ${feedUrl}`)
|
|
||||||
const eventData = {
|
|
||||||
feedUrl: feedUrl,
|
|
||||||
numFailed: numFailed || 0,
|
|
||||||
title: title || 'Unknown Title'
|
|
||||||
}
|
|
||||||
this.triggerNotification('onRSSFeedFailed', eventData)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles scheduled episode downloads disabled due to too many failed attempts
|
|
||||||
*
|
|
||||||
* @param {string} feedUrl
|
|
||||||
* @param {number} numFailed
|
|
||||||
* @param {string} title
|
|
||||||
*/
|
|
||||||
async onRSSFeedDisabled(feedUrl, numFailed, title) {
|
|
||||||
if (!Database.notificationSettings.isUseable) return
|
|
||||||
|
|
||||||
if (!Database.notificationSettings.getHasActiveNotificationsForEvent('onRSSFeedDisabled')) {
|
|
||||||
Logger.debug(`[NotificationManager] onRSSFeedDisabled: No active notifications`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.debug(`[NotificationManager] onRSSFeedDisabled: Podcast scheduled episode download disabled due to ${numFailed} failed requests for ${feedUrl}`)
|
|
||||||
const eventData = {
|
|
||||||
feedUrl: feedUrl,
|
|
||||||
numFailed: numFailed || 0,
|
|
||||||
title: title || 'Unknown Title'
|
|
||||||
}
|
|
||||||
this.triggerNotification('onRSSFeedDisabled', eventData)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} errorMsg
|
* @param {string} errorMsg
|
||||||
|
|
|
||||||
|
|
@ -347,12 +347,10 @@ class PodcastManager {
|
||||||
this.failedCheckMap[libraryItem.id]++
|
this.failedCheckMap[libraryItem.id]++
|
||||||
if (this.MaxFailedEpisodeChecks !== 0 && this.failedCheckMap[libraryItem.id] >= this.MaxFailedEpisodeChecks) {
|
if (this.MaxFailedEpisodeChecks !== 0 && this.failedCheckMap[libraryItem.id] >= this.MaxFailedEpisodeChecks) {
|
||||||
Logger.error(`[PodcastManager] runEpisodeCheck ${this.failedCheckMap[libraryItem.id]} failed attempts at checking episodes for "${libraryItem.media.title}" - disabling auto download`)
|
Logger.error(`[PodcastManager] runEpisodeCheck ${this.failedCheckMap[libraryItem.id]} failed attempts at checking episodes for "${libraryItem.media.title}" - disabling auto download`)
|
||||||
void NotificationManager.onRSSFeedDisabled(libraryItem.media.feedURL, this.failedCheckMap[libraryItem.id], libraryItem.media.title)
|
|
||||||
libraryItem.media.autoDownloadEpisodes = false
|
libraryItem.media.autoDownloadEpisodes = false
|
||||||
delete this.failedCheckMap[libraryItem.id]
|
delete this.failedCheckMap[libraryItem.id]
|
||||||
} else {
|
} else {
|
||||||
Logger.warn(`[PodcastManager] runEpisodeCheck ${this.failedCheckMap[libraryItem.id]} failed attempts at checking episodes for "${libraryItem.media.title}"`)
|
Logger.warn(`[PodcastManager] runEpisodeCheck ${this.failedCheckMap[libraryItem.id]} failed attempts at checking episodes for "${libraryItem.media.title}"`)
|
||||||
void NotificationManager.onRSSFeedFailed(libraryItem.media.feedURL, this.failedCheckMap[libraryItem.id], libraryItem.media.title)
|
|
||||||
}
|
}
|
||||||
} else if (newEpisodes.length) {
|
} else if (newEpisodes.length) {
|
||||||
delete this.failedCheckMap[libraryItem.id]
|
delete this.failedCheckMap[libraryItem.id]
|
||||||
|
|
|
||||||
|
|
@ -60,38 +60,6 @@ module.exports.notificationData = {
|
||||||
errorMsg: 'Example error message'
|
errorMsg: 'Example error message'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'onRSSFeedFailed',
|
|
||||||
requiresLibrary: true,
|
|
||||||
description: 'Triggered when the RSS feed request fails for an automatic episode download',
|
|
||||||
descriptionKey: 'NotificationOnRSSFeedFailedDescription',
|
|
||||||
variables: ['feedUrl', 'numFailed', 'title'],
|
|
||||||
defaults: {
|
|
||||||
title: 'RSS Feed Request Failed',
|
|
||||||
body: 'Failed to request 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 automatic episode downloads are disabled due to too many failed attempts',
|
|
||||||
descriptionKey: 'NotificationOnRSSFeedDisabledDescription',
|
|
||||||
variables: ['feedUrl', 'numFailed', 'title'],
|
|
||||||
defaults: {
|
|
||||||
title: 'Podcast Episode Download Schedule Disabled',
|
|
||||||
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: {
|
|
||||||
title: 'Test RSS Feed',
|
|
||||||
feedUrl: 'https://example.com/rss',
|
|
||||||
numFailed: 5
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'onTest',
|
name: 'onTest',
|
||||||
requiresLibrary: false,
|
requiresLibrary: false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue