mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 00:05:27 +02: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
|
@ -1,4 +1,5 @@
|
|||
const AudioFile = require('../files/AudioFile')
|
||||
const AudioTrack = require('../files/AudioTrack')
|
||||
|
||||
class PodcastEpisode {
|
||||
constructor(episode) {
|
||||
|
@ -37,5 +38,22 @@ class PodcastEpisode {
|
|||
updatedAt: this.updatedAt
|
||||
}
|
||||
}
|
||||
|
||||
get isPlaybackMediaEntity() { return true }
|
||||
get tracks() {
|
||||
return [this.audioFile]
|
||||
}
|
||||
|
||||
// Only checks container format
|
||||
checkCanDirectPlay(payload) {
|
||||
var supportedMimeTypes = payload.supportedMimeTypes || []
|
||||
return supportedMimeTypes.includes(this.audioFile.mimeType)
|
||||
}
|
||||
|
||||
getDirectPlayTracklist(libraryItemId) {
|
||||
var audioTrack = new AudioTrack()
|
||||
audioTrack.setData(libraryItemId, this.audioFile, 0)
|
||||
return [audioTrack]
|
||||
}
|
||||
}
|
||||
module.exports = PodcastEpisode
|
Loading…
Add table
Add a link
Reference in a new issue