mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-24 04:39:40 +00:00
Podcast episode downloader, update podcast data model
This commit is contained in:
parent
28d76d21f1
commit
920ca683b9
19 changed files with 407 additions and 49 deletions
|
|
@ -176,9 +176,11 @@ class Book {
|
|||
return this.metadata.setDataFromAudioMetaTags(audioFile.metaTags, overrideExistingDetails)
|
||||
}
|
||||
|
||||
setData(scanMediaMetadata) {
|
||||
setData(mediaPayload) {
|
||||
this.metadata = new BookMetadata()
|
||||
this.metadata.setData(scanMediaMetadata)
|
||||
if (mediaPayload.metadata) {
|
||||
this.metadata.setData(mediaPayload.metadata)
|
||||
}
|
||||
}
|
||||
|
||||
// Look for desc.txt, reader.txt, metadata.abs and opf file then update details if found
|
||||
|
|
|
|||
|
|
@ -118,10 +118,14 @@ class Podcast {
|
|||
return this.episodes[0]
|
||||
}
|
||||
|
||||
setData(metadata, coverPath = null, autoDownload = false) {
|
||||
this.metadata = new PodcastMetadata(metadata)
|
||||
this.coverPath = coverPath
|
||||
this.autoDownloadEpisodes = autoDownload
|
||||
setData(mediaMetadata) {
|
||||
this.metadata = new PodcastMetadata()
|
||||
if (mediaMetadata.metadata) {
|
||||
this.metadata.setData(mediaMetadata.metadata)
|
||||
}
|
||||
|
||||
this.coverPath = mediaMetadata.coverPath || null
|
||||
this.autoDownloadEpisodes = !!mediaMetadata.autoDownloadEpisodes
|
||||
}
|
||||
|
||||
async syncMetadataFiles(textMetadataFiles, opfMetadataOverrideDetails) {
|
||||
|
|
@ -150,5 +154,9 @@ class Podcast {
|
|||
this.episodes.forEach((ep) => total += ep.duration)
|
||||
return total
|
||||
}
|
||||
|
||||
addPodcastEpisode(podcastEpisode) {
|
||||
this.episodes.push(podcastEpisode)
|
||||
}
|
||||
}
|
||||
module.exports = Podcast
|
||||
Loading…
Add table
Add a link
Reference in a new issue