Remove test stream, add prod script

This commit is contained in:
Mark Cooper 2021-09-18 16:42:20 -05:00
parent f54d48270e
commit 2f6417dec2
2 changed files with 13 additions and 12 deletions

View File

@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"dev": "node index.js",
"start": "node index.js"
"start": "node index.js",
"prod": "NODE_ENV=production node index.js"
},
"author": "advplyr",
"license": "ISC",

View File

@ -1,5 +1,5 @@
const Stream = require('./objects/Stream')
const StreamTest = require('./test/StreamTest')
// const StreamTest = require('./test/StreamTest')
const Logger = require('./Logger')
const fs = require('fs-extra')
const Path = require('path')
@ -104,19 +104,19 @@ class StreamManager {
async openTestStream(streamPath, audiobookId) {
Logger.info('Open Stream Test Request', audiobookId)
var audiobook = this.audiobooks.find(ab => ab.id === audiobookId)
var stream = new StreamTest(streamPath, audiobook)
// var audiobook = this.audiobooks.find(ab => ab.id === audiobookId)
// var stream = new StreamTest(streamPath, audiobook)
stream.on('closed', () => {
console.log('Stream closed')
})
// stream.on('closed', () => {
// console.log('Stream closed')
// })
var playlistUri = await stream.generatePlaylist()
stream.start()
// var playlistUri = await stream.generatePlaylist()
// stream.start()
Logger.info('Stream Playlist', playlistUri)
Logger.info('Test Stream Opened for audiobook', audiobook.title, 'with streamId', stream.id)
return playlistUri
// Logger.info('Stream Playlist', playlistUri)
// Logger.info('Test Stream Opened for audiobook', audiobook.title, 'with streamId', stream.id)
// return playlistUri
}
streamUpdate(socket, { currentTime, streamId }) {