mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-27 14:19:38 +00:00
Add support to custom episode cover art
This commit is contained in:
parent
0c7b738b7c
commit
f703fb60da
16 changed files with 446 additions and 20 deletions
|
|
@ -33,6 +33,7 @@ const Fuse = require('../libs/fusejs')
|
|||
* @property {string} chaptersUrl
|
||||
* @property {string} chaptersType
|
||||
* @property {RssPodcastChapter[]} chapters
|
||||
* @property {string|null} image - Episode-specific iTunes image URL
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
@ -211,6 +212,11 @@ function extractEpisodeData(item) {
|
|||
}
|
||||
}
|
||||
|
||||
// Extract episode image
|
||||
if (item['itunes:image']?.[0]?.['$']?.href) {
|
||||
episode.image = item['itunes:image'][0]['$'].href
|
||||
}
|
||||
|
||||
const arrayFields = ['title', 'itunes:episodeType', 'itunes:season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
|
||||
arrayFields.forEach((key) => {
|
||||
const cleanKey = key.split(':').pop()
|
||||
|
|
@ -282,7 +288,8 @@ function cleanEpisodeData(data) {
|
|||
guid: data.guid || null,
|
||||
chaptersUrl: data.chaptersUrl || null,
|
||||
chaptersType: data.chaptersType || null,
|
||||
chapters: data.chapters || []
|
||||
chapters: data.chapters || [],
|
||||
image: data.image || null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue