New data model start of PlaybackSessionManager to replace StreamManager, remove podcast & ip npm package

This commit is contained in:
advplyr 2022-03-15 19:28:54 -05:00
parent 68b13ae45f
commit 0af6ad63c1
11 changed files with 109 additions and 116 deletions

View file

@ -1,8 +1,29 @@
const Path = require('path')
const PlaybackSession = require('./objects/PlaybackSession')
class PlaybackSessionManager {
constructor() {
constructor(db, emitter, clientEmitter) {
this.db = db
this.StreamsPath = Path.join(global.MetadataPath, 'streams')
this.emitter = emitter
this.clientEmitter = clientEmitter
this.sessions = []
}
startSessionRequest(req, res) {
var user = req.user
var libraryItem = req.libraryItem
var options = req.query
const session = this.startSession(user, libraryItem, options)
res.json(session)
}
startSession(user, libraryItem, options) {
// TODO: Determine what play method to use and setup playback session
const newPlaybackSession = new PlaybackSession()
this.sessions.push(newPlaybackSession)
return newPlaybackSession
}
}
module.exports = PlaybackSessionManager