From 6898b9f31d6641297754c5e2e1f5d58f624af7e7 Mon Sep 17 00:00:00 2001 From: vexorian Date: Tue, 21 Sep 2021 22:10:34 -0400 Subject: [PATCH 1/5] 1.5.0 --- README.md | 3 ++- src/constants.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6ec4761..5801a4a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# dizqueTV 1.5.0-development +# dizqueTV 1.5.0 ![Discord](https://img.shields.io/discord/711313431457693727?logo=discord&logoColor=fff&style=flat-square) ![GitHub top language](https://img.shields.io/github/languages/top/vexorian/dizquetv?logo=github&style=flat-square) ![Docker Pulls](https://img.shields.io/docker/pulls/vexorian/dizquetv?logo=docker&logoColor=fff&style=flat-square) Create live TV channel streams from media on your Plex servers. @@ -25,6 +25,7 @@ EPG (Guide Information) data is stored to `.dizquetv/xmltv.xml` - Subtitle support. - Auto deinterlace any Plex media not marked `"scanType": "progressive"` - Can be configured to completely force Direct play, if you are ready for the caveats. +- It's up to you if the channels have a life of their own and act as if they continued playing when you weren't watching them or if you want "on-demand" channels that stop their schedules while not being watched. ## Limitations diff --git a/src/constants.js b/src/constants.js index 49d5cf8..5865e39 100644 --- a/src/constants.js +++ b/src/constants.js @@ -28,5 +28,5 @@ module.exports = { // staying active, it checks every 5 seconds PLAYED_MONITOR_CHECK_FREQUENCY: 5*1000, - VERSION_NAME: "1.5.0-development" + VERSION_NAME: "1.5.0" } From 88f03638fbbc53e4d0fdc92f56b6dbeba0a3761b Mon Sep 17 00:00:00 2001 From: Nate Harris Date: Tue, 31 May 2022 14:56:20 -0600 Subject: [PATCH 2/5] - Show track title rather than album title on XML for songs --- src/services/tv-guide-service.js | 3 +++ src/xmltv.js | 1 + web/controllers/guide.js | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/tv-guide-service.js b/src/services/tv-guide-service.js index 6768b2f..98ce7ca 100644 --- a/src/services/tv-guide-service.js +++ b/src/services/tv-guide-service.js @@ -500,6 +500,9 @@ function makeEntry(channel, x) { episode: x.program.episode, title: x.program.title, } + } else if (x.program.type === 'track') { + title = x.program.title; + // TODO: Add sub data for tracks here for XML writing } } if (typeof(title)==='undefined') { diff --git a/src/xmltv.js b/src/xmltv.js index 5ca97cf..224de33 100644 --- a/src/xmltv.js +++ b/src/xmltv.js @@ -98,6 +98,7 @@ async function _writeProgramme(channel, program, xw, xmlSettings, cacheImageServ xw.writeRaw('\n ') //sub-title + // TODO: Add support for track data (artist, album) here if ( typeof(program.sub) !== 'undefined') { xw.startElement('sub-title') xw.writeAttribute('lang', 'en') diff --git a/web/controllers/guide.js b/web/controllers/guide.js index 7098b73..61ffa37 100644 --- a/web/controllers/guide.js +++ b/web/controllers/guide.js @@ -313,7 +313,7 @@ module.exports = function ($scope, $timeout, dizquetv) { ch.programs.push( { duration: addDuration(b - a), altTitle: altTitle, - showTitle: program.title, + showTitle: program.title, // movie title, episode title or track title subTitle: subTitle, episodeTitle : episodeTitle, start: hasStart, From 0d7529ea12c73708e27a36f695907bdc8a8f805d Mon Sep 17 00:00:00 2001 From: Nouser <1980162+Nouser@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:44:40 -0500 Subject: [PATCH 3/5] Video stream and web UI ports are now independent. New argument `--videoport` can be used to specify which port the video stream should be served from. If unspecified, the behavior is unchanged and the video stream and the web UI will be served from the same port. --- index.js | 19 ++++++++++++++++++- src/video.js | 13 +++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index cb8f60b..d735eb0 100644 --- a/index.js +++ b/index.js @@ -56,10 +56,13 @@ for (let i = 0, l = process.argv.length; i < l; i++) { process.env.PORT = process.argv[i + 1] if ((process.argv[i] === "-d" || process.argv[i] === "--database") && i + 1 !== l) process.env.DATABASE = process.argv[i + 1] + if ((process.argv[i] === "-p" || process.argv[i] === "--videoport") && i + 1 !== l) + process.env.PORT = process.argv[i + 1] } process.env.DATABASE = process.env.DATABASE || path.join(".", ".dizquetv") process.env.PORT = process.env.PORT || 8000 +process.env.VIDEO_PORT = process.env.VIDEO_PORT || process.env.PORT // Default to serving both on same port if (!fs.existsSync(process.env.DATABASE)) { if (fs.existsSync( path.join(".", ".pseudotv") )) { @@ -289,10 +292,24 @@ app.use('/api/cache/images', cacheImageService.apiRouters()) app.use('/' + fontAwesome, express.static(path.join(process.env.DATABASE, fontAwesome))) app.use('/' + bootstrap, express.static(path.join(process.env.DATABASE, bootstrap))) -app.use(video.router( channelService, fillerDB, db, programmingService, activeChannelService, programPlayTimeDB )) +// TODO: Should the hdhr router be included on the video stream port? I'm not super familiar with its functionality. app.use(hdhr.router) + +// Set up video router on appropriate port +if(process.env.PORT == process.env.VIDEO_PORT) { + app.use(video.router( channelService, fillerDB, db, programmingService, activeChannelService, programPlayTimeDB )) +} else { + // 2nd express app to listen on a different port + let videoApp = express() + videoApp.use(video.router( channelService, fillerDB, db, programmingService, activeChannelService, programPlayTimeDB )) + videoApp.listen(port = process.env.VIDEO_PORT, () => { + console.log(`Video stream server running on port: http://*:${process.env.VIDEO_PORT}`) + }) +} + app.listen(process.env.PORT, () => { console.log(`HTTP server running on port: http://*:${process.env.PORT}`) + // TODO: Resolve hdhr question from above. let hdhrSettings = db['hdhr-settings'].find()[0] if (hdhrSettings.autoDiscovery === true) hdhr.ssdp.start() diff --git a/src/video.js b/src/video.js index a2361dd..45c4666 100644 --- a/src/video.js +++ b/src/video.js @@ -125,7 +125,8 @@ function video( channelService, fillerDB, db, programmingService, activeChannelS }) let channelNum = parseInt(req.query.channel, 10) - let ff = await ffmpeg.spawnConcat(`http://localhost:${process.env.PORT}/playlist?channel=${channelNum}&audioOnly=${audioOnly}&stepNumber={step}`); + let ff = await ffmpeg.spawnConcat(`http://localhost:${process.env.VIDEO_PORT}/playlist?channel=${channelNum}&audioOnly=${audioOnly}&stepNumber=${step}`); + ff.pipe(res, { end: false} ); }; router.get('/video', async(req, res) => { @@ -599,22 +600,22 @@ function video( channelService, fillerDB, db, programmingService, activeChannelS && (stepNumber == 0) ) { //loading screen - data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&first=0&session=${sessionId}&audioOnly=${audioOnly}'\n`; + data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&first=0&session=${sessionId}&audioOnly=${audioOnly}'\n`; } let remaining = maxStreamsToPlayInARow; if (stepNumber == 0) { - data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&first=1&session=${sessionId}&audioOnly=${audioOnly}'\n` + data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&first=1&session=${sessionId}&audioOnly=${audioOnly}'\n` if (transcodingEnabled && (audioOnly !== true)) { - data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&between=1&session=${sessionId}&audioOnly=${audioOnly}'\n`; + data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&between=1&session=${sessionId}&audioOnly=${audioOnly}'\n`; } remaining--; } for (var i = 0; i < remaining; i++) { - data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&session=${sessionId}&audioOnly=${audioOnly}'\n` + data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&session=${sessionId}&audioOnly=${audioOnly}'\n` if (transcodingEnabled && (audioOnly !== true) ) { - data += `file 'http://localhost:${process.env.PORT}/stream?channel=${channelNum}&between=1&session=${sessionId}&audioOnly=${audioOnly}'\n` + data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&session=${sessionId}&audioOnly=${audioOnly}'\n` } } From 2778b38998c62151b7ab846385594d6af9577626 Mon Sep 17 00:00:00 2001 From: Nouser <1980162+Nouser@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:59:03 -0500 Subject: [PATCH 4/5] Fixes video port CLI argument --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d735eb0..8f10475 100644 --- a/index.js +++ b/index.js @@ -56,7 +56,7 @@ for (let i = 0, l = process.argv.length; i < l; i++) { process.env.PORT = process.argv[i + 1] if ((process.argv[i] === "-d" || process.argv[i] === "--database") && i + 1 !== l) process.env.DATABASE = process.argv[i + 1] - if ((process.argv[i] === "-p" || process.argv[i] === "--videoport") && i + 1 !== l) + if ((process.argv[i] === "-v" || process.argv[i] === "--videoport") && i + 1 !== l) process.env.PORT = process.argv[i + 1] } From b7635504e862b1302af6b062293df9b9547511b8 Mon Sep 17 00:00:00 2001 From: Nouser <1980162+Nouser@users.noreply.github.com> Date: Tue, 20 Feb 2024 17:05:59 -0500 Subject: [PATCH 5/5] Fixes accidentally removed `between` parameter --- src/video.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video.js b/src/video.js index 45c4666..f58ef16 100644 --- a/src/video.js +++ b/src/video.js @@ -615,7 +615,7 @@ function video( channelService, fillerDB, db, programmingService, activeChannelS for (var i = 0; i < remaining; i++) { data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&session=${sessionId}&audioOnly=${audioOnly}'\n` if (transcodingEnabled && (audioOnly !== true) ) { - data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&session=${sessionId}&audioOnly=${audioOnly}'\n` + data += `file 'http://localhost:${process.env.VIDEO_PORT}/stream?channel=${channelNum}&between=1&session=${sessionId}&audioOnly=${audioOnly}'\n` } }