mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Merge pull request #1505 from p-rintz/master
Add library tags variable to podcast notifications
This commit is contained in:
commit
da7825e3e3
@ -24,9 +24,15 @@ class NotificationManager {
|
|||||||
libraryItemId: libraryItem.id,
|
libraryItemId: libraryItem.id,
|
||||||
libraryId: libraryItem.libraryId,
|
libraryId: libraryItem.libraryId,
|
||||||
libraryName: library ? library.name : 'Unknown',
|
libraryName: library ? library.name : 'Unknown',
|
||||||
|
mediaTags: (libraryItem.media.tags || []).join(', '),
|
||||||
podcastTitle: libraryItem.media.metadata.title,
|
podcastTitle: libraryItem.media.metadata.title,
|
||||||
|
podcastAuthor: libraryItem.media.metadata.author || '',
|
||||||
|
podcastDescription: libraryItem.media.metadata.description || '',
|
||||||
|
podcastGenres: (libraryItem.media.metadata.genres || []).join(', '),
|
||||||
episodeId: episode.id,
|
episodeId: episode.id,
|
||||||
episodeTitle: episode.title
|
episodeTitle: episode.title,
|
||||||
|
episodeSubtitle: episode.subtitle || '',
|
||||||
|
episodeDescription: episode.description || ''
|
||||||
}
|
}
|
||||||
this.triggerNotification('onPodcastEpisodeDownloaded', eventData)
|
this.triggerNotification('onPodcastEpisodeDownloaded', eventData)
|
||||||
}
|
}
|
||||||
@ -110,4 +116,4 @@ class NotificationManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = NotificationManager
|
module.exports = NotificationManager
|
||||||
|
@ -7,7 +7,7 @@ module.exports.notificationData = {
|
|||||||
requiresLibrary: true,
|
requiresLibrary: true,
|
||||||
libraryMediaType: 'podcast',
|
libraryMediaType: 'podcast',
|
||||||
description: 'Triggered when a podcast episode is auto-downloaded',
|
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: {
|
defaults: {
|
||||||
title: 'New {{podcastTitle}} Episode!',
|
title: 'New {{podcastTitle}} Episode!',
|
||||||
body: '{{episodeTitle}} has been added to {{libraryName}} library.'
|
body: '{{episodeTitle}} has been added to {{libraryName}} library.'
|
||||||
@ -16,9 +16,15 @@ module.exports.notificationData = {
|
|||||||
libraryItemId: 'li_notification_test',
|
libraryItemId: 'li_notification_test',
|
||||||
libraryId: 'lib_test',
|
libraryId: 'lib_test',
|
||||||
libraryName: 'Podcasts',
|
libraryName: 'Podcasts',
|
||||||
|
mediaTags: 'TestTag1, TestTag2',
|
||||||
podcastTitle: 'Abs Test Podcast',
|
podcastTitle: 'Abs Test Podcast',
|
||||||
|
podcastAuthor: 'Audiobookshelf',
|
||||||
|
podcastDescription: 'Description of the Abs Test Podcast belongs here.',
|
||||||
|
podcastGenres: 'TestGenre1, TestGenre2',
|
||||||
episodeId: 'ep_notification_test',
|
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 = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user