mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-01-03 01:29:37 +00:00
New data model play media entity, PlaybackSessionManager
This commit is contained in:
parent
1cf9e85272
commit
099ae7c776
54 changed files with 841 additions and 902 deletions
|
|
@ -119,6 +119,15 @@ class Book {
|
|||
getAudiobookById(audiobookId) {
|
||||
return this.audiobooks.find(ab => ab.id === audiobookId)
|
||||
}
|
||||
getMediaEntityById(entityId) {
|
||||
var ent = this.audiobooks.find(ab => ab.id === entityId)
|
||||
if (ent) return ent
|
||||
return this.ebooks.find(eb => eb.id === entityId)
|
||||
}
|
||||
getPlaybackMediaEntity() { // Get first playback media entity
|
||||
if (!this.audiobooks.length) return null
|
||||
return this.audiobooks[0]
|
||||
}
|
||||
|
||||
removeFileWithInode(inode) {
|
||||
var audiobookWithIno = this.audiobooks.find(ab => ab.findFileWithInode(inode))
|
||||
|
|
@ -262,9 +271,5 @@ class Book {
|
|||
// newEbook.setData(libraryFile)
|
||||
// this.ebookFiles.push(newEbook)
|
||||
}
|
||||
|
||||
getDirectPlayTracklist(options) {
|
||||
|
||||
}
|
||||
}
|
||||
module.exports = Book
|
||||
|
|
@ -117,6 +117,14 @@ class Podcast {
|
|||
return null
|
||||
}
|
||||
|
||||
getMediaEntityById(entityId) {
|
||||
return this.episodes.find(ep => ep.id === entityId)
|
||||
}
|
||||
getPlaybackMediaEntity() { // Get first playback media entity
|
||||
if (!this.episodes.length) return null
|
||||
return this.episodes[0]
|
||||
}
|
||||
|
||||
setData(scanMediaMetadata) {
|
||||
this.metadata = new PodcastMetadata()
|
||||
this.metadata.setData(scanMediaMetadata)
|
||||
|
|
@ -130,9 +138,5 @@ class Podcast {
|
|||
var payload = this.metadata.searchQuery(query)
|
||||
return payload || {}
|
||||
}
|
||||
|
||||
getDirectPlayTracklist(options) {
|
||||
|
||||
}
|
||||
}
|
||||
module.exports = Podcast
|
||||
Loading…
Add table
Add a link
Reference in a new issue