Merge remote-tracking branch 'origin/main' into edge
This commit is contained in:
commit
08c81f97a2
@ -1,4 +1,4 @@
|
|||||||
# dizqueTV 1.5.2
|
# dizqueTV 1.5.3
|
||||||
  
|
  
|
||||||
|
|
||||||
Create live TV channel streams from media on your Plex servers.
|
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)
|
* 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
|
* 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
|
||||||
24
index.js
24
index.js
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
const db = require('diskdb')
|
const db = require('diskdb')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
const unzip = require('unzipper')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const express = require('express')
|
const express = require('express')
|
||||||
const bodyParser = require('body-parser')
|
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') );
|
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'])
|
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)
|
initDB(db, channelDB)
|
||||||
|
|
||||||
channelService = new ChannelService(channelDB);
|
channelService = new ChannelService(channelDB);
|
||||||
@ -282,6 +286,8 @@ app.use('/custom.css', express.static(path.join(process.env.DATABASE, 'custom.cs
|
|||||||
// API Routers
|
// API Routers
|
||||||
app.use(api.router(db, channelService, fillerDB, customShowDB, xmltvInterval, guideService, m3uService, eventService ))
|
app.use(api.router(db, channelService, fillerDB, customShowDB, xmltvInterval, guideService, m3uService, eventService ))
|
||||||
app.use('/api/cache/images', cacheImageService.apiRouters())
|
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(video.router( channelService, fillerDB, db, programmingService, activeChannelService, programPlayTimeDB ))
|
||||||
app.use(hdhr.router)
|
app.use(hdhr.router)
|
||||||
@ -293,6 +299,7 @@ app.listen(process.env.PORT, () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function initDB(db, channelDB) {
|
function initDB(db, channelDB) {
|
||||||
|
//TODO: this is getting so repetitive, do it better
|
||||||
if (!fs.existsSync(process.env.DATABASE + '/images/dizquetv.png')) {
|
if (!fs.existsSync(process.env.DATABASE + '/images/dizquetv.png')) {
|
||||||
let data = fs.readFileSync(path.resolve(path.join(__dirname, 'resources/dizquetv.png')))
|
let data = fs.readFileSync(path.resolve(path.join(__dirname, 'resources/dizquetv.png')))
|
||||||
fs.writeFileSync(process.env.DATABASE + '/images/dizquetv.png', data)
|
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')))
|
let data = fs.readFileSync(path.resolve(path.join(__dirname, 'resources', 'default-custom.css')))
|
||||||
fs.writeFileSync( path.join(process.env.DATABASE, 'custom.css'), data)
|
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 }));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,7 @@
|
|||||||
"random-js": "2.1.0",
|
"random-js": "2.1.0",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"uuid": "9.0.1",
|
"uuid": "9.0.1",
|
||||||
|
"unzipper": "0.10.14",
|
||||||
"xml-writer": "^1.7.0"
|
"xml-writer": "^1.7.0"
|
||||||
},
|
},
|
||||||
"bin": "dist/index.js",
|
"bin": "dist/index.js",
|
||||||
|
|||||||
BIN
resources/bootstrap-4.4.1-dist.zip
Normal file
BIN
resources/bootstrap-4.4.1-dist.zip
Normal file
Binary file not shown.
BIN
resources/fontawesome-free-5.15.4-web.zip
Normal file
BIN
resources/fontawesome-free-5.15.4-web.zip
Normal file
Binary file not shown.
@ -35,5 +35,5 @@ module.exports = {
|
|||||||
// staying active, it checks every 5 seconds
|
// staying active, it checks every 5 seconds
|
||||||
PLAYED_MONITOR_CHECK_FREQUENCY: 5*1000,
|
PLAYED_MONITOR_CHECK_FREQUENCY: 5*1000,
|
||||||
|
|
||||||
VERSION_NAME: "1.5.2"
|
VERSION_NAME: "1.5.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -495,9 +495,17 @@ class FFMPEG extends events.EventEmitter {
|
|||||||
if ( transcodeVideo && (this.audioOnly !== true) ) {
|
if ( transcodeVideo && (this.audioOnly !== true) ) {
|
||||||
// add the video encoder flags
|
// add the video encoder flags
|
||||||
ffmpegArgs.push(
|
ffmpegArgs.push(
|
||||||
|
'-crf', '22',
|
||||||
`-maxrate:v`, `${this.opts.videoBitrate}k`,
|
`-maxrate:v`, `${this.opts.videoBitrate}k`,
|
||||||
`-bufsize:v`, `${this.opts.videoBufSize}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 ) {
|
if ( transcodeAudio ) {
|
||||||
// add the audio encoder flags
|
// add the audio encoder flags
|
||||||
|
|||||||
@ -7,8 +7,19 @@ function equalItems(a, b) {
|
|||||||
if ( (typeof(a) === 'undefined') || a.isOffline || b.isOffline ) {
|
if ( (typeof(a) === 'undefined') || a.isOffline || b.isOffline ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
console.log("no idea how to compare this: " + JSON.stringify(a) );
|
if (
|
||||||
console.log(" with this: " + JSON.stringify(b) );
|
(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;
|
return a.title === b.title;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -183,6 +183,11 @@ function video( channelService, fillerDB, db, programmingService, activeChannelS
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ffmpegSettings.disablePreludes === true) {
|
||||||
|
//disable the preludes
|
||||||
|
isBetween = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,8 @@
|
|||||||
<title>dizqueTV</title>
|
<title>dizqueTV</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="icon" type="image/png" href="/favicon.svg" ></link>
|
<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="bootstrap-4.4.1-dist/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="fontawesome-free-5.15.4-web/css/all.css">
|
||||||
<link href="style.css" rel="stylesheet">
|
<link href="style.css" rel="stylesheet">
|
||||||
<link href="custom.css" rel="stylesheet">
|
<link href="custom.css" rel="stylesheet">
|
||||||
<script src="version.js"></script>
|
<script src="version.js"></script>
|
||||||
|
|||||||
@ -196,6 +196,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user