New data model play media entity, PlaybackSessionManager

This commit is contained in:
advplyr 2022-03-17 19:10:47 -05:00
parent 1cf9e85272
commit 099ae7c776
54 changed files with 841 additions and 902 deletions

View file

@ -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

View file

@ -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