Merge remote-tracking branch 'origin/main' into edge

This commit is contained in:
vexorian 2023-11-28 23:24:26 -04:00
commit 08c81f97a2
11 changed files with 69 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# dizqueTV 1.5.2
# dizqueTV 1.5.3
![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.
@ -75,3 +75,5 @@ npm run dev-server
* Original pseudotv-Plex code was released under [MIT license (c) 2020 Dan Ferguson](https://github.com/DEFENDORe/pseudotv/blob/665e71e24ee5e93d9c9c90545addb53fdc235ff6/LICENSE)
* dizqueTV's improvements are released under zlib license (c) 2020 Victor Hugo Soliz Kuncar
* FontAwesome: [https://fontawesome.com/license/free](https://archive.fo/PRqis)
* Bootstrap: https://github.com/twbs/bootstrap/blob/v4.4.1/LICENSE

View File

@ -1,6 +1,7 @@
const db = require('diskdb')
const fs = require('fs')
const unzip = require('unzipper')
const path = require('path')
const express = require('express')
const bodyParser = require('body-parser')
@ -90,6 +91,9 @@ if(!fs.existsSync(path.join(process.env.DATABASE, 'cache','images'))) {
channelDB = new ChannelDB( path.join(process.env.DATABASE, 'channels') );
db.connect(process.env.DATABASE, ['channels', 'plex-servers', 'ffmpeg-settings', 'plex-settings', 'xmltv-settings', 'hdhr-settings', 'db-version', 'client-id', 'cache-images', 'settings'])
let fontAwesome = "fontawesome-free-5.15.4-web";
let bootstrap = "bootstrap-4.4.1-dist";
initDB(db, channelDB)
channelService = new ChannelService(channelDB);
@ -282,6 +286,8 @@ app.use('/custom.css', express.static(path.join(process.env.DATABASE, 'custom.cs
// API Routers
app.use(api.router(db, channelService, fillerDB, customShowDB, xmltvInterval, guideService, m3uService, eventService ))
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 ))
app.use(hdhr.router)
@ -293,6 +299,7 @@ app.listen(process.env.PORT, () => {
})
function initDB(db, channelDB) {
//TODO: this is getting so repetitive, do it better
if (!fs.existsSync(process.env.DATABASE + '/images/dizquetv.png')) {
let data = fs.readFileSync(path.resolve(path.join(__dirname, 'resources/dizquetv.png')))
fs.writeFileSync(process.env.DATABASE + '/images/dizquetv.png', data)
@ -330,7 +337,24 @@ function initDB(db, channelDB) {
let data = fs.readFileSync(path.resolve(path.join(__dirname, 'resources', 'default-custom.css')))
fs.writeFileSync( path.join(process.env.DATABASE, 'custom.css'), data)
}
if (!fs.existsSync( path.join(process.env.DATABASE, fontAwesome) )) {
let sourceZip = path.resolve(__dirname, 'resources', fontAwesome) + ".zip";
let destinationPath = path.resolve(process.env.DATABASE);
fs.createReadStream(sourceZip)
.pipe(unzip.Extract({ path: destinationPath }));
}
if (!fs.existsSync( path.join(process.env.DATABASE, bootstrap) )) {
let sourceZip = path.resolve(__dirname, 'resources', bootstrap) + ".zip";
let destinationPath = path.resolve(process.env.DATABASE);
fs.createReadStream(sourceZip)
.pipe(unzip.Extract({ path: destinationPath }));
}
}

View File

@ -38,6 +38,7 @@
"random-js": "2.1.0",
"request": "^2.88.2",
"uuid": "9.0.1",
"unzipper": "0.10.14",
"xml-writer": "^1.7.0"
},
"bin": "dist/index.js",

Binary file not shown.

Binary file not shown.

View File

@ -35,5 +35,5 @@ module.exports = {
// staying active, it checks every 5 seconds
PLAYED_MONITOR_CHECK_FREQUENCY: 5*1000,
VERSION_NAME: "1.5.2"
VERSION_NAME: "1.5.3"
}

View File

@ -495,9 +495,17 @@ class FFMPEG extends events.EventEmitter {
if ( transcodeVideo && (this.audioOnly !== true) ) {
// add the video encoder flags
ffmpegArgs.push(
'-crf', '22',
`-maxrate:v`, `${this.opts.videoBitrate}k`,
`-bufsize:v`, `${this.opts.videoBufSize}k`
);
if (this.opts.videoEncoder.toLowerCase() === "mpeg2video") {
// This makes message "impossible bitrate constraints, this will fail" appear but nothing actually fails and it really looks like b:v is the only way to make the video look good when using mpeg2video
ffmpegArgs.push(
`-qscale:v`, `1`,
'-b:v', `${this.opts.videoBitrate}k`
);
}
}
if ( transcodeAudio ) {
// add the audio encoder flags

View File

@ -7,8 +7,19 @@ function equalItems(a, b) {
if ( (typeof(a) === 'undefined') || a.isOffline || b.isOffline ) {
return false;
}
console.log("no idea how to compare this: " + JSON.stringify(a) );
console.log(" with this: " + JSON.stringify(b) );
if (
(a.type === "loading") || (a.type === "interlude")
|| (b.type === "loading") || (b.type === "interlude")
) {
return (a.type === b.type);
}
if (a.type != b.type) {
return false;
}
if (a.type !== "program") {
console.log("no idea how to compare this: " + JSON.stringify(a).slice(0,100) );
console.log(" with this: " + JSON.stringify(b).slice(0,100) );
}
return a.title === b.title;
}

View File

@ -183,6 +183,11 @@ function video( channelService, fillerDB, db, programmingService, activeChannelS
return
}
if (ffmpegSettings.disablePreludes === true) {
//disable the preludes
isBetween = false;
}

View File

@ -4,8 +4,8 @@
<title>dizqueTV</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="/favicon.svg" ></link>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
<link rel="stylesheet" href="bootstrap-4.4.1-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="fontawesome-free-5.15.4-web/css/all.css">
<link href="style.css" rel="stylesheet">
<link href="custom.css" rel="stylesheet">
<script src="version.js"></script>

View File

@ -196,6 +196,18 @@
</div>
</div>
<br ></br>
<div class="row">
<div class="col-sm-9">
<div class="form-group">
<input id="disablePreludes" type="checkbox" ng-model="settings.disablePreludes" ng-disabled="isTranscodingNotNeeded()" ></input>
<label for="disablePreludes">Disable Preludes</label>
<small class="form-text text-muted">In an attempt to improve playback, dizqueTV insets really short clips of black screen between videos. The idea is that if the stream pauses because Plex is taking too long to reply, it will pause during one of those black screens instead of interrupting the last second of a video. If you suspect these black screens are causing trouble instead of helping, you can disable them with this option.
</small>
</div>
</div>
</div>
</div>