mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-10 09:24:56 +02:00
Update Book.js to return array of AudioTrack objects on json expand
This commit is contained in:
parent
609bf4309f
commit
6e5e638076
7 changed files with 33 additions and 20 deletions
|
@ -59,8 +59,10 @@ class LibraryItem {
|
|||
this.mediaType = libraryItem.mediaType
|
||||
if (this.mediaType === 'book') {
|
||||
this.media = new Book(libraryItem.media)
|
||||
this.media.libraryItemId = this.id
|
||||
} else if (this.mediaType === 'podcast') {
|
||||
this.media = new Podcast(libraryItem.media)
|
||||
this.media.libraryItemId = this.id
|
||||
}
|
||||
|
||||
this.libraryFiles = libraryItem.libraryFiles.map(f => new LibraryFile(f))
|
||||
|
@ -163,9 +165,11 @@ class LibraryItem {
|
|||
if (libraryMediaType === 'podcast') {
|
||||
this.mediaType = 'podcast'
|
||||
this.media = new Podcast()
|
||||
this.media.libraryItemId = this.id
|
||||
} else {
|
||||
this.mediaType = 'book'
|
||||
this.media = new Book()
|
||||
this.media.libraryItemId = this.id
|
||||
}
|
||||
|
||||
|
||||
|
@ -440,8 +444,8 @@ class LibraryItem {
|
|||
return this.media.searchQuery(query)
|
||||
}
|
||||
|
||||
getDirectPlayTracklist(libraryItemId, episodeId) {
|
||||
return this.media.getDirectPlayTracklist(libraryItemId, episodeId)
|
||||
getDirectPlayTracklist(episodeId) {
|
||||
return this.media.getDirectPlayTracklist(episodeId)
|
||||
}
|
||||
}
|
||||
module.exports = LibraryItem
|
Loading…
Add table
Add a link
Reference in a new issue