1.5.5
This commit is contained in:
parent
7e9db8c1f6
commit
196033844a
@ -1,4 +1,4 @@
|
||||
# dizqueTV 1.5.4
|
||||
# dizqueTV 1.5.5
|
||||
  
|
||||
|
||||
Create live TV channel streams from media on your Plex servers.
|
||||
|
||||
7
index.js
7
index.js
@ -51,14 +51,15 @@ if (NODE < 12) {
|
||||
console.error(`WARNING: Your nodejs version ${process.version} is lower than supported. dizqueTV has been tested best on nodejs 12.16.`);
|
||||
}
|
||||
|
||||
process.env.unlock = false;
|
||||
unlockPath = false;
|
||||
for (let i = 0, l = process.argv.length; i < l; i++) {
|
||||
if ((process.argv[i] === "-p" || process.argv[i] === "--port") && i + 1 !== l)
|
||||
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] === "--unlock") {
|
||||
process.env.unlock = true;
|
||||
unlockPath = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,7 +106,7 @@ channelService = new ChannelService(channelDB);
|
||||
fillerDB = new FillerDB( path.join(process.env.DATABASE, 'filler') , channelService );
|
||||
customShowDB = new CustomShowDB( path.join(process.env.DATABASE, 'custom-shows') );
|
||||
let programPlayTimeDB = new ProgramPlayTimeDB( path.join(process.env.DATABASE, 'play-cache') );
|
||||
let ffmpegSettingsService = new FfmpegSettingsService(db, process.env.unlock);
|
||||
let ffmpegSettingsService = new FfmpegSettingsService(db, unlockPath);
|
||||
|
||||
async function initializeProgramPlayTimeDB() {
|
||||
try {
|
||||
|
||||
@ -35,5 +35,5 @@ module.exports = {
|
||||
// staying active, it checks every 5 seconds
|
||||
PLAYED_MONITOR_CHECK_FREQUENCY: 5*1000,
|
||||
|
||||
VERSION_NAME: "1.5.4"
|
||||
VERSION_NAME: "1.5.5"
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
const path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
const TARGET_VERSION = 804;
|
||||
const TARGET_VERSION = 805;
|
||||
const DAY_MS = 1000 * 60 * 60 * 24;
|
||||
|
||||
const STEPS = [
|
||||
@ -44,7 +44,8 @@ const STEPS = [
|
||||
[ 800, 801, (db) => addImageCache(db) ],
|
||||
[ 801, 802, () => addGroupTitle() ],
|
||||
[ 802, 803, () => fixNonIntegerDurations() ],
|
||||
[ 803, 804, (db) => addFFMpegLock(db) ],
|
||||
[ 803, 805, (db) => addFFMpegLock(db) ],
|
||||
[ 804, 805, (db) => addFFMpegLock(db) ],
|
||||
]
|
||||
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
@ -386,7 +387,8 @@ function ffmpeg() {
|
||||
//How default ffmpeg settings should look
|
||||
configVersion: 5,
|
||||
ffmpegPath: "/usr/bin/ffmpeg",
|
||||
pathLockDate: new Date().getTime() + DAY_MS,
|
||||
ffmpegPathLockDate: new Date().getTime() + DAY_MS,
|
||||
threads: 4,
|
||||
concatMuxDelay: "0",
|
||||
logFfmpeg: false,
|
||||
enableFFMPEGTranscoding: true,
|
||||
@ -770,12 +772,12 @@ function addScalingAlgorithm(db) {
|
||||
function addFFMpegLock(db) {
|
||||
let ffmpegSettings = db['ffmpeg-settings'].find()[0];
|
||||
let f = path.join(process.env.DATABASE, 'ffmpeg-settings.json');
|
||||
if ( typeof(ffmpegSettings.pathLockDate) === 'undefined' || ffmpegSettings.pathLockDate == null ) {
|
||||
if ( typeof(ffmpegSettings.ffmpegPathLockDate) === 'undefined' || ffmpegSettings.ffmpegPathLockDate == null ) {
|
||||
|
||||
console.log("Adding ffmpeg lock. For your security it will not be possible to modify the ffmpeg path using the UI anymore unless you launch dizquetv by following special instructions..");
|
||||
// We are migrating an existing db that had a ffmpeg path. Make sure
|
||||
// it's already locked.
|
||||
ffmpegSettings.pathLockDate = new Date().getTime() - 2 * DAY_MS;
|
||||
ffmpegSettings.ffmpegPathLockDate = new Date().getTime() - 2 * DAY_MS;
|
||||
}
|
||||
fs.writeFileSync( f, JSON.stringify( [ffmpegSettings] ) );
|
||||
}
|
||||
|
||||
@ -17,33 +17,33 @@ class FfmpegSettingsService {
|
||||
ffmpeg.lock = true;
|
||||
}
|
||||
// Hid this info from the API
|
||||
delete ffmpeg.pathLockDate;
|
||||
delete ffmpeg.ffmpegPathLockDate;
|
||||
return ffmpeg;
|
||||
}
|
||||
|
||||
unlock() {
|
||||
let ffmpeg = this.getCurrentState();
|
||||
console.log("ffmpeg path UI unlocked for another day...");
|
||||
ffmpeg.pathLockDate = new Date().getTime() + DAY_MS;
|
||||
ffmpeg.ffmpegPathLockDate = new Date().getTime() + DAY_MS;
|
||||
this.db['ffmpeg-settings'].update({ _id: ffmpeg._id }, ffmpeg)
|
||||
}
|
||||
|
||||
|
||||
update(attempt) {
|
||||
let ffmpeg = this.getCurrentState();
|
||||
attempt.pathLockDate = ffmpeg.pathLockDate;
|
||||
attempt.ffmpegPathLockDate = ffmpeg.ffmpegPathLockDate;
|
||||
if (isLocked(ffmpeg)) {
|
||||
console.log("Note: ffmpeg path is not being updated since it's been locked for your security.");
|
||||
attempt.ffmpegPath = ffmpeg.ffmpegPath;
|
||||
if (typeof(ffmpeg.pathLockDate) === 'undefined') {
|
||||
if (typeof(ffmpeg.ffmpegPathLockDate) === 'undefined') {
|
||||
// make sure to lock it even if it was undefined
|
||||
attempt.pathLockDate = new Date().getTime() - DAY_MS;
|
||||
attempt.ffmpegPathLockDate = new Date().getTime() - DAY_MS;
|
||||
}
|
||||
} else if (attempt.addLock === true) {
|
||||
// lock it right now
|
||||
attempt.pathLockDate = new Date().getTime() - DAY_MS;
|
||||
attempt.ffmpegPathLockDate = new Date().getTime() - DAY_MS;
|
||||
} else {
|
||||
attempt.pathLockDate = new Date().getTime() + DAY_MS;
|
||||
attempt.ffmpegPathLockDate = new Date().getTime() + DAY_MS;
|
||||
}
|
||||
delete attempt.addLock;
|
||||
delete attempt.lock;
|
||||
@ -115,7 +115,7 @@ function isValidFilePath(filePath) {
|
||||
}
|
||||
|
||||
function isLocked(ffmpeg) {
|
||||
return isNaN(ffmpeg.pathLockDate) || ffmpeg.pathLockDate < new Date().getTime();
|
||||
return isNaN(ffmpeg.ffmpegPathLockDate) || ffmpeg.ffmpegPathLockDate < new Date().getTime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user