mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-16 00:39:40 +00:00
Update podcast rss feed parser to use psc chapters on episodes
This commit is contained in:
parent
ddcda197b4
commit
6ed66fea16
5 changed files with 102 additions and 2 deletions
|
|
@ -607,6 +607,7 @@ class Feed extends Model {
|
|||
custom_namespaces: {
|
||||
itunes: 'http://www.itunes.com/dtds/podcast-1.0.dtd',
|
||||
podcast: 'https://podcastindex.org/namespace/1.0',
|
||||
psc: 'http://podlove.org/simple-chapters',
|
||||
googleplay: 'http://www.google.com/schemas/play-podcasts/1.0'
|
||||
},
|
||||
custom_elements: customElements
|
||||
|
|
|
|||
|
|
@ -325,6 +325,24 @@ class FeedEpisode extends Model {
|
|||
customElements.push({ 'itunes:summary': { _cdata: this.description } })
|
||||
}
|
||||
|
||||
customElements.push({
|
||||
'psc:chapters': [
|
||||
{
|
||||
_attr: {
|
||||
version: '1.2'
|
||||
},
|
||||
'psc:chapter': [
|
||||
{
|
||||
_attr: {
|
||||
title: 'Test',
|
||||
start: '00:00:00'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
return {
|
||||
title: this.title,
|
||||
description: this.description || '',
|
||||
|
|
|
|||
|
|
@ -80,9 +80,13 @@ class PodcastEpisode extends Model {
|
|||
if (rssPodcastEpisode.guid) {
|
||||
podcastEpisode.extraData.guid = rssPodcastEpisode.guid
|
||||
}
|
||||
|
||||
if (audioFile.chapters?.length) {
|
||||
podcastEpisode.chapters = audioFile.chapters.map((ch) => ({ ...ch }))
|
||||
} else if (rssPodcastEpisode.chapters?.length) {
|
||||
podcastEpisode.chapters = rssPodcastEpisode.chapters.map((ch) => ({ ...ch }))
|
||||
}
|
||||
|
||||
return this.create(podcastEpisode)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue