mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-02 01:05:25 +02: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
|
@ -166,8 +166,10 @@ class LibraryItem {
|
|||
} else {
|
||||
this.mediaType = 'book'
|
||||
this.media = new Book()
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (const key in payload) {
|
||||
if (key === 'libraryFiles') {
|
||||
this.libraryFiles = payload.libraryFiles.map(lf => lf.clone())
|
||||
|
@ -175,13 +177,13 @@ class LibraryItem {
|
|||
// Use first image library file as cover
|
||||
var firstImageFile = this.libraryFiles.find(lf => lf.fileType === 'image')
|
||||
if (firstImageFile) this.media.coverPath = firstImageFile.metadata.path
|
||||
} else if (this[key] !== undefined) {
|
||||
} else if (this[key] !== undefined && key !== 'media') {
|
||||
this[key] = payload[key]
|
||||
}
|
||||
}
|
||||
|
||||
if (payload.mediaMetadata) {
|
||||
this.media.setData(payload.mediaMetadata)
|
||||
if (payload.media) {
|
||||
this.media.setData(payload.media)
|
||||
}
|
||||
|
||||
this.addedAt = Date.now()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue