mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-06 02:32:44 +02:00
Podcast episode downloader, update podcast data model
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user