From 3bb492f204520b9a3165ff0ec6719ea73480d8fb Mon Sep 17 00:00:00 2001 From: tycrek Date: Fri, 30 Jul 2021 11:10:49 -0600 Subject: [PATCH] added isProd package --- package.json | 1 + thumbnails.js | 4 ++-- utils.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bec3d3e..64f7025 100755 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "dependencies": { "@tycrek/ass-storage-engine": "0.2.7", "@tycrek/express-nofavicon": "^1.0.2", + "@tycrek/isprod": "^2.0.2", "@tycrek/log": ">=0.5.x", "any-shell-escape": "^0.1.1", "aws-sdk": "^2.930.0", diff --git a/thumbnails.js b/thumbnails.js index b2f5d35..1648323 100644 --- a/thumbnails.js +++ b/thumbnails.js @@ -2,7 +2,7 @@ const ffmpeg = require('ffmpeg-static'); const Jimp = require('jimp'); const shell = require('any-shell-escape'); const { exec } = require('child_process'); -const { path } = require('./utils'); +const { isProd, path } = require('./utils'); const { diskFilePath } = require('./config.json'); // Thumbnail parameters @@ -21,7 +21,7 @@ const THUMBNAIL = { function getCommand(src, dest) { return shell([ ffmpeg, '-y', - '-v', (process.env.NODE_ENV === 'production' ? 'error' : 'debug'), // Log level + '-v', (isProd ? 'error' : 'debug'), // Log level '-i', src, // Input file '-ss', '00:00:01.000', // Timestamp of frame to grab '-frames:v', '1', // Number of frames to grab diff --git a/utils.js b/utils.js index f0a17e1..d459a37 100755 --- a/utils.js +++ b/utils.js @@ -104,6 +104,7 @@ GENERATORS.set(idModes.r, randomGen); GENERATORS.set(idModes.gfy, gfyGen); module.exports = { + isProd: require('@tycrek/isprod')(), path, getTrueHttp, getTrueDomain,