Skip to content

Commit

Permalink
Fix eslint warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Marnalas committed Mar 22, 2024
1 parent 839e769 commit 6c61150
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ var plugin = function (args) {
// eslint-disable-next-line no-param-reassign
stream.typeIndex = index;
});
var getSimplifiedStreams = function (streams) {
return streams.map(function (stream) {
return { index: stream.typeIndex, codec_name: stream.codec_name, codec_type: stream.codec_type };
});
var getSimplifiedStreams = function (streamsToSimplify) {
return streamsToSimplify.map(function (stream) { return ({
index: stream.typeIndex,
codec_name: stream.codec_name,
codec_type: stream.codec_type,
}); });
};
var originalStreams = JSON.stringify(getSimplifiedStreams(streams));
var sortStreams = function (sortType) {
Expand Down Expand Up @@ -174,10 +176,10 @@ var plugin = function (args) {
args.variables.ffmpegCommand.shouldProcess = true;
// eslint-disable-next-line no-param-reassign
args.variables.ffmpegCommand.streams = streams;
args.jobLog("Streams are not in order. Reordering.");
args.jobLog('Streams are not in order. Reordering.');
}
else
args.jobLog("\u2714 Streams are already in order. No reordering necessary.");
args.jobLog('✔ Streams are already in order. No reordering necessary.');
return {
outputFileObj: args.inputFileObj,
outputNumber: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,13 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
stream.typeIndex = index;
});

const getSimplifiedStreams = (streams: IffmpegCommandStream[]) =>
streams.map(stream => {
return { index: stream.typeIndex, codec_name: stream.codec_name, codec_type: stream.codec_type };
});
const getSimplifiedStreams =
(streamsToSimplify: IffmpegCommandStream[]) =>
streamsToSimplify.map((stream) => ({
index: stream.typeIndex,
codec_name: stream.codec_name,
codec_type: stream.codec_type,
}));

const originalStreams = JSON.stringify(getSimplifiedStreams(streams));

Expand Down Expand Up @@ -227,9 +230,8 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
args.variables.ffmpegCommand.shouldProcess = true;
// eslint-disable-next-line no-param-reassign
args.variables.ffmpegCommand.streams = streams;
args.jobLog(`Streams are not in order. Reordering.`);
} else
args.jobLog(`✔ Streams are already in order. No reordering necessary.`);
args.jobLog('Streams are not in order. Reordering.');
} else args.jobLog('✔ Streams are already in order. No reordering necessary.');

return {
outputFileObj: args.inputFileObj,
Expand Down

0 comments on commit 6c61150

Please sign in to comment.