Merge pull request #1505 from p-rintz/master

Add library tags variable to podcast notifications
This commit is contained in:
advplyr 2023-02-15 15:58:59 -06:00 committed by GitHub
commit da7825e3e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View File

@ -24,9 +24,15 @@ class NotificationManager {
libraryItemId: libraryItem.id,
libraryId: libraryItem.libraryId,
libraryName: library ? library.name : 'Unknown',
mediaTags: (libraryItem.media.tags || []).join(', '),
podcastTitle: libraryItem.media.metadata.title,
podcastAuthor: libraryItem.media.metadata.author || '',
podcastDescription: libraryItem.media.metadata.description || '',
podcastGenres: (libraryItem.media.metadata.genres || []).join(', '),
episodeId: episode.id,
episodeTitle: episode.title
episodeTitle: episode.title,
episodeSubtitle: episode.subtitle || '',
episodeDescription: episode.description || ''
}
this.triggerNotification('onPodcastEpisodeDownloaded', eventData)
}
@ -110,4 +116,4 @@ class NotificationManager {
})
}
}
module.exports = NotificationManager
module.exports = NotificationManager

View File

@ -7,7 +7,7 @@ module.exports.notificationData = {
requiresLibrary: true,
libraryMediaType: 'podcast',
description: 'Triggered when a podcast episode is auto-downloaded',
variables: ['libraryItemId', 'libraryId', 'podcastTitle', 'episodeTitle', 'libraryName', 'episodeId'],
variables: ['libraryItemId', 'libraryId', 'podcastTitle', 'podcastAuthor', 'podcastDescription', 'podcastGenres', 'episodeTitle', 'episodeSubtitle', 'episodeDescription', 'libraryName', 'episodeId', 'mediaTags'],
defaults: {
title: 'New {{podcastTitle}} Episode!',
body: '{{episodeTitle}} has been added to {{libraryName}} library.'
@ -16,9 +16,15 @@ module.exports.notificationData = {
libraryItemId: 'li_notification_test',
libraryId: 'lib_test',
libraryName: 'Podcasts',
mediaTags: 'TestTag1, TestTag2',
podcastTitle: 'Abs Test Podcast',
podcastAuthor: 'Audiobookshelf',
podcastDescription: 'Description of the Abs Test Podcast belongs here.',
podcastGenres: 'TestGenre1, TestGenre2',
episodeId: 'ep_notification_test',
episodeTitle: 'Successful Test'
episodeTitle: 'Successful Test Episode',
episodeSubtitle: 'Episode Subtitle',
episodeDescription: 'Some description of the podcast episode.'
}
},
{
@ -35,4 +41,4 @@ module.exports.notificationData = {
}
}
]
}
}