Skip to content

Commit

Permalink
Log texts have been generalised
Browse files Browse the repository at this point in the history
Updated the log output to a more generalised text
  • Loading branch information
r0guepacket committed Sep 21, 2024
1 parent 2055f0f commit f61f8e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ var plugin = function (args) {
args.jobLog("origFileDuration: ".concat(origFileDuration));
var thresholdSecs = Number(args.inputs.thresholdSecs);
var durationText = "File has duration is ".concat(origFileDuration.toFixed(3), " seconds");
var seriesText = 'File duration within series limits. must be a series.';
var filmText = 'File duration longer than series limits. must be a film.';
var belowText = 'File duration is below threshold.';
var aboveText = 'File duration is above threshold.';
var outputNumber = 1;
if (origFileDuration < thresholdSecs) {
args.jobLog("".concat(seriesText, " ").concat(durationText, ", threshold is ").concat(thresholdSecs, " seconds"));
args.jobLog("".concat(belowText, " ").concat(durationText, ", threshold is ").concat(thresholdSecs, " seconds"));
outputNumber = 1;
}
else if (origFileDuration >= thresholdSecs) {
args.jobLog("".concat(filmText, " ").concat(durationText, ", threshold is ").concat(thresholdSecs, " seconds"));
args.jobLog("".concat(aboveText, " ").concat(durationText, ", threshold is ").concat(thresholdSecs, " seconds"));
outputNumber = 2;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {

const thresholdSecs = Number(args.inputs.thresholdSecs);
const durationText = `File has duration is ${origFileDuration.toFixed(3)} seconds`;
const seriesText = 'File duration within series limits. must be a series.';
const filmText = 'File duration longer than series limits. must be a film.';
const belowText = 'File duration is below threshold.';
const aboveText = 'File duration is above threshold.';

let outputNumber = 1;

if (origFileDuration < thresholdSecs) {
args.jobLog(`${seriesText} ${durationText}, threshold is ${thresholdSecs} seconds`);
args.jobLog(`${belowText} ${durationText}, threshold is ${thresholdSecs} seconds`);
outputNumber = 1;
} else if (origFileDuration >= thresholdSecs) {
args.jobLog(`${filmText} ${durationText}, threshold is ${thresholdSecs} seconds`);
args.jobLog(`${aboveText} ${durationText}, threshold is ${thresholdSecs} seconds`);
outputNumber = 2;
} else {
args.jobLog(durationText);
Expand Down

0 comments on commit f61f8e1

Please sign in to comment.