Remove test stream, add prod script

This commit is contained in:
advplyr 2021-09-18 16:42:20 -05:00
parent ea61400329
commit a63d76985c
2 changed files with 13 additions and 12 deletions

View File

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

View File

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