mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-13 17:07:03 +02:00
Update Book.js to return array of AudioTrack objects on json expand
This commit is contained in:
@ -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
|
Reference in New Issue
Block a user