diff --git a/.eslintrc.json b/.eslintrc.json index 2b6b52b..d321d96 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,31 +1,87 @@ { - "env": { - "commonjs": true, - "es6": true, - "node": true - }, - "extends": [ - "airbnb-base" + "settings": { + "import/resolver": { + "node": { + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx" + ] + } + } + }, + "env": { + "commonjs": true, + "es6": true, + "node": true + }, + "extends": [ + "airbnb-base", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" + ], + "plugins": [ + "prefer-arrow-functions" + ], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018, + "project": [ + "./tsconfig.eslint.json" + ] + }, + "rules": { + "func-style": [ + "error", + "expression" + ], + "prefer-arrow-functions/prefer-arrow-functions": [ + "warn", + { + "classPropertiesAllowed": false, + "disallowPrototype": false, + "returnStyle": "unchanged", + "singleReturnOnly": false + } + ], + "require-await":["error"], + "global-require": 0, + "no-void": 0, + "@typescript-eslint/no-floating-promises": [ + "error" ], - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "parserOptions": { - "ecmaVersion": 2020 - }, - "rules": { - "global-require":0, - "class-methods-use-this": 0, - "no-case-declarations": 0, - "camelcase": 0, - "jsx-a11y/click-events-have-key-events": 0, - "no-underscore-dangle": ["error", { "allow": ["_id"] }], - "max-len": [ - "error", - { - "code": 120 - } + "@typescript-eslint/no-var-requires": 0, + "class-methods-use-this": 0, + "no-case-declarations": 0, + "camelcase": 0, + "jsx-a11y/click-events-have-key-events": 0, + "no-underscore-dangle": [ + "error", + { + "allow": [ + "_id" ] } + ], + "max-len": [ + "error", + { + "code": 120 + } + ], + "import/extensions": [ + "error", + "ignorePackages", + { + "js": "never", + "jsx": "never", + "ts": "never", + "tsx": "never" + } + ] + } } \ No newline at end of file diff --git a/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js index 79b766b..ef3bacc 100644 --- a/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js +++ b/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js @@ -65,10 +65,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js b/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js index 05e6f6b..f9637e9 100644 --- a/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js +++ b/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js @@ -153,10 +153,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js index 995603e..a32bce8 100644 --- a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js +++ b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -75,10 +75,10 @@ HandBrake examples: ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js index 5925da3..c0b3594 100644 --- a/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js +++ b/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js @@ -64,10 +64,10 @@ If no specified language track exists, the best untagged/undefined stream will b ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index 21881b2..8bbb5bb 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -83,10 +83,10 @@ The default order is suitable for most people. ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_remove_audio_by_channel_count.js b/Community/Tdarr_Plugin_00td_action_remove_audio_by_channel_count.js index 4b286f8..b64dd7b 100644 --- a/Community/Tdarr_Plugin_00td_action_remove_audio_by_channel_count.js +++ b/Community/Tdarr_Plugin_00td_action_remove_audio_by_channel_count.js @@ -30,10 +30,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js b/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js index fac55d4..4c80689 100644 --- a/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js +++ b/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js @@ -41,10 +41,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_remux_container.js b/Community/Tdarr_Plugin_00td_action_remux_container.js index d43cf84..0427bda 100644 --- a/Community/Tdarr_Plugin_00td_action_remux_container.js +++ b/Community/Tdarr_Plugin_00td_action_remux_container.js @@ -25,10 +25,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js b/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js index 4d59668..9d40de9 100644 --- a/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js +++ b/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js @@ -36,10 +36,10 @@ into the specified codec. Bitrate and channel count are kept the same. ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_action_transcode.js b/Community/Tdarr_Plugin_00td_action_transcode.js index 38f1eb6..978c6f5 100644 --- a/Community/Tdarr_Plugin_00td_action_transcode.js +++ b/Community/Tdarr_Plugin_00td_action_transcode.js @@ -212,7 +212,7 @@ const hasEncoder = async ({ }; // credit to UNCode101 for this -const getBestNvencDevice = async ({ +const getBestNvencDevice = ({ response, inputs, nvencDevice, @@ -369,10 +369,10 @@ const getEncoder = async ({ }; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = async (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_filter_bit_depth.js b/Community/Tdarr_Plugin_00td_filter_bit_depth.js index b479a0f..576568a 100644 --- a/Community/Tdarr_Plugin_00td_filter_bit_depth.js +++ b/Community/Tdarr_Plugin_00td_filter_bit_depth.js @@ -50,10 +50,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_filter_break_stack_if_processed.js b/Community/Tdarr_Plugin_00td_filter_break_stack_if_processed.js index 942de91..599f6ce 100644 --- a/Community/Tdarr_Plugin_00td_filter_break_stack_if_processed.js +++ b/Community/Tdarr_Plugin_00td_filter_break_stack_if_processed.js @@ -12,10 +12,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: true, diff --git a/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/Community/Tdarr_Plugin_00td_filter_by_bitrate.js index 7219b51..89d4777 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_bitrate.js +++ b/Community/Tdarr_Plugin_00td_filter_by_bitrate.js @@ -31,10 +31,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_filter_by_codec.js b/Community/Tdarr_Plugin_00td_filter_by_codec.js index 2f2d6fa..3e54406 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_codec.js +++ b/Community/Tdarr_Plugin_00td_filter_by_codec.js @@ -31,10 +31,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js b/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js index a24a83d..80a145c 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js +++ b/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js @@ -33,10 +33,10 @@ Leave blank if using codecTagStringsToProcess`, ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_filter_by_file_property.js b/Community/Tdarr_Plugin_00td_filter_by_file_property.js index e37c10a..e0ae80c 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_file_property.js +++ b/Community/Tdarr_Plugin_00td_filter_by_file_property.js @@ -151,10 +151,10 @@ const conditionMet = (response, inputsArr, value, condition) => { return false; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_filter_by_resolution.js b/Community/Tdarr_Plugin_00td_filter_by_resolution.js index c63c435..81fcd80 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_resolution.js +++ b/Community/Tdarr_Plugin_00td_filter_by_resolution.js @@ -35,10 +35,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_filter_by_size.js b/Community/Tdarr_Plugin_00td_filter_by_size.js index 2e9ae67..bc750be 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_size.js +++ b/Community/Tdarr_Plugin_00td_filter_by_size.js @@ -33,10 +33,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js b/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js index 99763e4..ca17d06 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js +++ b/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js @@ -63,11 +63,11 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const { strHasValue } = require('../methods/utils'); const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js b/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js index e699050..a12cae6 100644 --- a/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js +++ b/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js @@ -11,11 +11,11 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object diff --git a/Community/Tdarr_Plugin_075a_Transcode_Customisable.js b/Community/Tdarr_Plugin_075a_Transcode_Customisable.js index 7a144d1..887b01c 100644 --- a/Community/Tdarr_Plugin_075a_Transcode_Customisable.js +++ b/Community/Tdarr_Plugin_075a_Transcode_Customisable.js @@ -150,11 +150,11 @@ const details = () => ({ } ); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js b/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js index 27699a7..add16c4 100644 --- a/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js +++ b/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js b/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js index 565926d..f3ddf68 100644 --- a/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js +++ b/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js b/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js index c17a3a7..d6d0bff 100644 --- a/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js +++ b/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_076a_re_order_audio_streams.js b/Community/Tdarr_Plugin_076a_re_order_audio_streams.js index 8b3ecc7..4eb5104 100644 --- a/Community/Tdarr_Plugin_076a_re_order_audio_streams.js +++ b/Community/Tdarr_Plugin_076a_re_order_audio_streams.js @@ -41,11 +41,11 @@ const details = () => { }; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js b/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js index 65a3b86..0a73024 100644 --- a/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js +++ b/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js @@ -41,11 +41,11 @@ const details = () => { }; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js b/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js index 086dadd..ba6d7a2 100644 --- a/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js +++ b/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js @@ -55,11 +55,11 @@ const details = () => { }; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js b/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js index 5a868a5..f83c78d 100644 --- a/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js +++ b/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js @@ -14,11 +14,11 @@ const details = () => { }; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object at some point in the function else plugin will fail. diff --git a/Community/Tdarr_Plugin_43az_add_to_radarr.js b/Community/Tdarr_Plugin_43az_add_to_radarr.js index 8129e09..7b67158 100644 --- a/Community/Tdarr_Plugin_43az_add_to_radarr.js +++ b/Community/Tdarr_Plugin_43az_add_to_radarr.js @@ -58,11 +58,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const request = require('request'); const IP = inputs.server_ip; diff --git a/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js b/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js index a52d188..61e4446 100644 --- a/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js +++ b/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js @@ -109,7 +109,7 @@ const response = { }; // var response // Finds the first video stream and populates some useful variables -function getMediaInfo(file) { +const getMediaInfo = (file) => { let videoIdx = -1; for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { @@ -128,12 +128,12 @@ function getMediaInfo(file) { } } MediaInfo.overallBR = file.mediaInfo.track[0].OverallBitRate; -} // end getMediaInfo() +}; // end getMediaInfo() -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); if (file.fileMedium !== 'video') { diff --git a/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js b/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js index e8793e6..3aadf9f 100644 --- a/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js +++ b/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js @@ -474,11 +474,11 @@ function buildVideoConfiguration(inputs, file, logger) { } //#endregion -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var response = { container: ".mkv", diff --git a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index cfab9f6..7a62b7c 100644 --- a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -69,11 +69,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); const os = require('os'); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { container: '.mkv', diff --git a/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js b/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js index 0c5a59f..df4f667 100644 --- a/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js +++ b/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js @@ -26,10 +26,10 @@ const details = () => ({ module.exports.details = details; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { // 320K selected over 384k intentionally diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js index 767018c..9142106 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js @@ -212,7 +212,7 @@ how it works **this does a lot** and is 1 of 2 routines you should to run **Part }], }); -function findMediaInfoItem(file, index) { +const findMediaInfoItem = (file, index) => { let currMIOrder = -1; const strStreamType = file.ffProbeData.streams[index].codec_type.toLowerCase(); @@ -230,13 +230,13 @@ function findMediaInfoItem(file, index) { } } return -1; -} +}; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { // eslint-disable-next-line global-require const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js index e055894..736c24a 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js @@ -163,11 +163,11 @@ const details = () => { } } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var response = { diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js index f9ebae2..7b655fe 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -109,10 +109,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js index 2228163..8d4d579 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -88,10 +88,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/Community/Tdarr_Plugin_MC93_Migz1Remux.js index 9ba65b7..275689e 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ b/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -48,10 +48,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js b/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js index 127e159..94b33dc 100644 --- a/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js +++ b/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js @@ -67,10 +67,10 @@ Optional. Only removes titles if they contain at least 3 '.' characters. ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js index f2e6fc9..3067029 100644 --- a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -85,10 +85,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js b/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js index fe55253..a98b496 100644 --- a/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js +++ b/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js @@ -60,10 +60,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js index dae6c01..b9deb1c 100644 --- a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js @@ -65,10 +65,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js b/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js index 1da1993..2be21f1 100644 --- a/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js +++ b/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js @@ -11,10 +11,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js index 6768bad..bfd0a5d 100644 --- a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js +++ b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js @@ -11,10 +11,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js index f29ce6f..3b3f93b 100644 --- a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js +++ b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js @@ -60,10 +60,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // eslint-disable-next-line import/no-unresolved const request = require('request'); diff --git a/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js b/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js index bce6bf4..560a88d 100644 --- a/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js +++ b/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js @@ -42,11 +42,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var response = { processFile: false, diff --git a/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js b/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js index 4530e48..1d39115 100644 --- a/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js +++ b/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js @@ -41,11 +41,11 @@ const details = () => { } } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var response = { processFile: false, diff --git a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js index a1fea64..ac54163 100644 --- a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js +++ b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js @@ -179,10 +179,10 @@ const getloudNormValues = async (inputs, response, file) => { return loudNormValues; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = async (file, librarySettings, inputs, otherArguments) => { - const lib = require('../methods/lib')(); const fs = require('fs'); - // eslint-disable-next-line no-unused-vars,no-param-reassign + const lib = require('../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object at some point diff --git a/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js b/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js index d083a33..1413441 100644 --- a/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js +++ b/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js @@ -16,11 +16,11 @@ const details = () => { } } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object at some point diff --git a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js index 2334353..2571214 100644 --- a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js +++ b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js @@ -55,10 +55,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js index 86c6dea..952713f 100644 --- a/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js +++ b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js @@ -75,10 +75,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // eslint-disable-next-line import/no-unresolved,import/no-extraneous-dependencies const request = require('request'); @@ -115,7 +115,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { }, url: `${ADDRESS}:${PORT}/triggers/manual?dir=${filepath}`, }, - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars (error, res, body) => { if (error) { // eslint-disable-next-line no-console diff --git a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js index 1412281..e05d8d7 100644 --- a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js +++ b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -252,7 +252,7 @@ class Configurator { * @param {string} type the typeo of stream. * @param {function} method the method to call. */ -function loopOverStreamsOfType(file, type, method) { +const loopOverStreamsOfType = (file, type, method) => { let id = 0; for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { if (file.ffProbeData.streams[i].codec_type.toLowerCase() === type) { @@ -260,9 +260,9 @@ function loopOverStreamsOfType(file, type, method) { id += 1; } } -} +}; -function buildAudioConfiguration(inputs, file, logger) { +const buildAudioConfiguration = (inputs, file, logger) => { const configuration = new Configurator(['-c:a copy']); let stream_count = 0; let streams_removing = 0; @@ -351,9 +351,9 @@ function buildAudioConfiguration(inputs, file, logger) { } return configuration; -} +}; -function buildVideoConfiguration(inputs, file, logger) { +const buildVideoConfiguration = (inputs, file, logger) => { const configuration = new Configurator(['-map 0', '-map -0:d', '-c:v copy']); loopOverStreamsOfType(file, 'video', (stream, id) => { @@ -430,9 +430,9 @@ function buildVideoConfiguration(inputs, file, logger) { } return configuration; -} +}; -function buildSubtitleConfiguration(inputs, file, logger) { +const buildSubtitleConfiguration = (inputs, file, logger) => { const configuration = new Configurator(['-c:s copy']); // webvtt @@ -497,12 +497,12 @@ function buildSubtitleConfiguration(inputs, file, logger) { } return configuration; -} +}; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object const response = { diff --git a/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js b/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js index 8565365..a6a3303 100644 --- a/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js index d782b1b..cd3bd61 100644 --- a/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js +++ b/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js @@ -15,11 +15,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js b/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js index d95a3e4..20fd46a 100644 --- a/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js +++ b/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js @@ -15,11 +15,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js b/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js index c09e788..7657b2b 100644 --- a/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js +++ b/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js @@ -64,11 +64,11 @@ const details = () => { }; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/Community/Tdarr_Plugin_a9he_New_file_size_check.js index 32e99d6..f1dbb9a 100644 --- a/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -35,7 +35,7 @@ const details = () => ({ const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object at some point in the function else plugin will fail. const response = { diff --git a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js index 4cda5ca..fcc9561 100644 --- a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js +++ b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js @@ -38,7 +38,7 @@ const details = () => ({ const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object at some point in the function else plugin will fail. const response = { diff --git a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js index c790869..0ab7785 100644 --- a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js +++ b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js b/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js index 0546d04..9b9bce2 100644 --- a/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js +++ b/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js @@ -27,10 +27,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object diff --git a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index e54637b..001bcb7 100644 --- a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -333,12 +333,12 @@ let videoBR = 0; // Finds the first video stream and get video bitrate -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); const os = require('os'); const proc = require('child_process'); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js b/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js index bdd492e..ae412a3 100644 --- a/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js +++ b/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js @@ -36,11 +36,11 @@ const details = () => { }; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var response = { processFile: false, diff --git a/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js b/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js index 699968b..e878b46 100644 --- a/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js +++ b/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var transcode = 0; //if this var changes to 1 the file will be transcoded var bitrateprobe = 0; //bitrate from ffprobe diff --git a/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js b/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js index c1b9ea4..a139ccb 100644 --- a/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js +++ b/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var transcode = 0; //if this var changes to 1 the file will be transcoded //default values that will be returned diff --git a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js index 2dc1a31..32cb083 100644 --- a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js +++ b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js @@ -56,11 +56,11 @@ function getPreset(preset) { const GOOD = true; const BAD = false; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var response = { diff --git a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js index ee7fba8..45ee6c1 100644 --- a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -411,11 +411,11 @@ function buildVideoConfiguration(inputs, file, logger) { //#endregion -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var response = { container: ".mkv", diff --git a/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js index 3bb5280..5d350f3 100644 --- a/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js index 5cca05c..887eca9 100644 --- a/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js index 7ca1c11..c8d042c 100644 --- a/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js index 7b56fdf..8a634f4 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js @@ -34,11 +34,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); const fs = require("fs"); const execSync = require("child_process").execSync; - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //default response var response = { diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js b/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js index d36415e..7cf5ce4 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js @@ -43,11 +43,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); const exec = require("child_process").exec; const fs = require("fs"); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); if (inputs.languages == "" || typeof inputs.special == "undefined") { var languages = ["eng", "en"]; //these languages should be kept, named according to ISO 639-2 language scheme diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js b/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js index 2a47266..84764e2 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js @@ -34,11 +34,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); const fs = require("fs"); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); if (inputs.bitrate == "" || inputs.bitrate == "undefined") { var min_bitrate = 6600; diff --git a/Community/Tdarr_Plugin_f4k1_aune_audio_to_flac.js b/Community/Tdarr_Plugin_f4k1_aune_audio_to_flac.js index d2632a1..05c42bc 100644 --- a/Community/Tdarr_Plugin_f4k1_aune_audio_to_flac.js +++ b/Community/Tdarr_Plugin_f4k1_aune_audio_to_flac.js @@ -30,10 +30,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { diff --git a/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js b/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js index 49203be..2b1b946 100644 --- a/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js +++ b/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js b/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js index 9afa86a..eb1e0fa 100644 --- a/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js +++ b/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js @@ -132,7 +132,7 @@ const details = () => ({ ], }); -function checkReply(response, statusCode, urlNoToken) { +const checkReply = (response, statusCode, urlNoToken) => { if (statusCode === 200) { response.infoLog += '☒ Above shown folder scanned in Plex! \n'; } else if (statusCode === 401) { @@ -144,12 +144,12 @@ function checkReply(response, statusCode, urlNoToken) { response.infoLog += `There was an issue reaching Plex. The URL used was ${urlNoToken}[redacted] \n`; } -} +}; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = async (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const http = require('http'); const https = require('https'); diff --git a/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js b/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js index cf46df8..06e8eaf 100644 --- a/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js +++ b/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js @@ -66,10 +66,10 @@ const details = () => ({ }], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js b/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js index b4d4ea4..e88bdce 100644 --- a/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js +++ b/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js @@ -204,7 +204,7 @@ const tmdbApi = async (filename, api_key, axios) => { }; // eslint-disable-next-line consistent-return -const parseArrResponse = async (body, filePath, arr) => { +const parseArrResponse = (body, filePath, arr) => { // eslint-disable-next-line default-case switch (arr) { case 'radarr': @@ -214,10 +214,10 @@ const parseArrResponse = async (body, filePath, arr) => { } }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = async (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // eslint-disable-next-line import/no-unresolved const axios = require('axios').default; @@ -244,7 +244,7 @@ const plugin = async (file, librarySettings, inputs, otherArguments) => { case 'radarr': if (tmdbResult) break; if (inputs.radarr_api_key) { - radarrResult = await parseArrResponse( + radarrResult = parseArrResponse( await axios .get( `http://${inputs.radarr_url}/api/v3/parse?apikey=${inputs.radarr_api_key}&title=${fileNameEncoded}`, @@ -269,7 +269,7 @@ const plugin = async (file, librarySettings, inputs, otherArguments) => { case 'sonarr': if (tmdbResult) break; if (inputs.sonarr_api_key) { - sonarrResult = await parseArrResponse( + sonarrResult = parseArrResponse( await axios.get( `http://${inputs.sonarr_url}/api/v3/parse?apikey=${inputs.sonarr_api_key}&title=${fileNameEncoded}`, ) diff --git a/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js b/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js index 76e5104..235117c 100644 --- a/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js +++ b/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js b/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js index 88bd347..3954b3e 100644 --- a/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js +++ b/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js index 8baf72e..6470e37 100644 --- a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js +++ b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js @@ -11,10 +11,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js index bf5c9a5..06a7ece 100644 --- a/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js +++ b/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js b/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js index e380b81..1f55145 100644 --- a/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js b/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js index fd2242d..a9653b4 100644 --- a/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js +++ b/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var transcode = 0; //if this var changes to 1 the file will be transcoded diff --git a/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js b/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js index 6d236a5..f44c337 100644 --- a/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js +++ b/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var transcode = 0; //if this var changes to 1 the file will be transcoded diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index 75d5e77..b8b65ee 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -35,10 +35,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); const fs = require('fs'); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object at some point in the function else plugin will fail. const response = { diff --git a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js index 689d403..b2b9d7d 100644 --- a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js +++ b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/Community/Tdarr_Plugin_s7x8_winsome_h265.js index b1b293f..2c1108a 100644 --- a/Community/Tdarr_Plugin_s7x8_winsome_h265.js +++ b/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js index d5d23f6..fd243f6 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js index f336a5e..11ed514 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js index 00df33b..261792d 100644 --- a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js +++ b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js index 9be9ed1..b8778d2 100644 --- a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js +++ b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js @@ -14,11 +14,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_tsld_filter_modified_date.js b/Community/Tdarr_Plugin_tsld_filter_modified_date.js index 6015f26..9458197 100644 --- a/Community/Tdarr_Plugin_tsld_filter_modified_date.js +++ b/Community/Tdarr_Plugin_tsld_filter_modified_date.js @@ -27,10 +27,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: true, diff --git a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 634c9d3..53505d5 100644 --- a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index 16def02..6088c13 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -151,10 +151,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); let crf; // default values that will be returned diff --git a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js index 4afd5f3..efb0641 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js @@ -103,11 +103,11 @@ const details = () => { } } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); var transcode = 0 //if this var changes to 1 the file will be transcoded var subcli = `-c:s copy` diff --git a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js index 7bd12ff..3fa5aa9 100644 --- a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js +++ b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js @@ -13,11 +13,11 @@ const details = () => { }; } -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); //Must return this object diff --git a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js index f5fe57a..17ff326 100644 --- a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js +++ b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -11,10 +11,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: false, diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 88fc14e..5b859dd 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -13,10 +13,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object diff --git a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js index 7cff564..5d15917 100644 --- a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js +++ b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js @@ -15,11 +15,11 @@ const details = () => { }; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); try { var fs = require("fs"); diff --git a/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js b/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js index 1a2f75d..ece12d9 100644 --- a/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js +++ b/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js @@ -11,10 +11,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); try { const fs = require('fs'); diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index fbc9de3..0a84a77 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -13,10 +13,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index 28ee579..52c58ac 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -13,10 +13,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index 597003f..7b7623c 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -15,10 +15,10 @@ const details = () => ({ }); // eslint-disable-next-line -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object diff --git a/Community/Tdarr_Plugin_z80t_keep_original_date.js b/Community/Tdarr_Plugin_z80t_keep_original_date.js index 9364705..25c9a02 100644 --- a/Community/Tdarr_Plugin_z80t_keep_original_date.js +++ b/Community/Tdarr_Plugin_z80t_keep_original_date.js @@ -63,10 +63,10 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = async (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // eslint-disable-next-line import/no-unresolved const axios = require('axios'); @@ -75,14 +75,14 @@ const plugin = async (file, librarySettings, inputs, otherArguments) => { // eslint-disable-next-line import/no-unresolved const path = require('path-extra'); - function log(msg) { + const log = (msg) => { if (inputs.log === true) { // eslint-disable-next-line no-console console.log(msg); } - } + }; - async function getFileData(filePath, extensions, server) { + const getFileData = async (filePath, extensions, server) => { const originalExtension = path.extname(filePath).split('.')[1]; if (extensions.indexOf(originalExtension) > -1) { extensions.splice(extensions.indexOf(originalExtension), 1); @@ -114,7 +114,7 @@ const plugin = async (file, librarySettings, inputs, otherArguments) => { } log('Could not get file info from API, giving up.'); return httpResponse; - } + }; const responseData = { file, diff --git a/FlowPlugins/CommunityFlowPlugins/classic/runClassicFilterPlugin/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/classic/runClassicFilterPlugin/1.0.0/index.js new file mode 100644 index 0000000..2b7b255 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/classic/runClassicFilterPlugin/1.0.0/index.js @@ -0,0 +1,139 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Run Classic Filter Plugin', + description: 'Run one of Tdarr\'s classic plugins that has Operation: Filter', + style: { + borderColor: 'orange', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'pluginSourceId', + type: 'string', + defaultValue: 'Community:Tdarr_Plugin_00td_filter_by_codec', + inputUI: { + type: 'dropdown', + options: [], + }, + tooltip: 'Specify the classic plugin ID', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File met conditions, would traditionally continue to next plugin in plugin stack', + }, + { + number: 2, + tooltip: 'File did not meet conditions, would traditionally break out of plugin stack', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var path, lib, pluginSourceId, parts, pluginSource, pluginId, relativePluginPath, absolutePath, classicPlugin, res, container, cacheFilePath, otherArguments, result, outputNumber; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + path = require('path'); + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + pluginSourceId = String(args.inputs.pluginSourceId); + parts = pluginSourceId.split(':'); + pluginSource = parts[0]; + pluginId = parts[1]; + relativePluginPath = "../../../../../".concat(pluginSource, "/").concat(pluginId, ".js"); + absolutePath = path.resolve(__dirname, relativePluginPath); + if (!(pluginSource === 'Community')) return [3 /*break*/, 1]; + classicPlugin = args.deps.importFresh(relativePluginPath); + return [3 /*break*/, 3]; + case 1: return [4 /*yield*/, args.deps.axiosMiddleware('api/v2/read-plugin', { + plugin: { + id: pluginId, + source: pluginSource, + }, + })]; + case 2: + res = _a.sent(); + classicPlugin = args.deps.requireFromString(res.pluginRaw, absolutePath); + _a.label = 3; + case 3: + if (classicPlugin.details().Operation !== 'Filter') { + throw new Error("".concat('This plugin is meant for classic plugins that have ' + + 'Operation: Filter. This classic plugin has Operation: ').concat(classicPlugin.details().Operation) + + 'Please use the Run Classic Transcode Flow Plugin plugin instead.'); + } + container = (0, fileUtils_1.getContainer)(args.inputFileObj._id); + cacheFilePath = "".concat(args.workDir, "/tempFile_").concat(new Date().getTime(), ".").concat(container); + otherArguments = { + handbrakePath: args.handbrakePath, + ffmpegPath: args.ffmpegPath, + mkvpropeditPath: args.mkvpropeditPath, + originalLibraryFile: args.originalLibraryFile, + nodeHardwareType: args.nodeHardwareType, + pluginCycle: 0, + workerType: args.workerType, + version: args.config.version, + platform_arch_isdocker: args.platform_arch_isdocker, + cacheFilePath: cacheFilePath, + job: args.job, + }; + return [4 /*yield*/, classicPlugin.plugin(args.inputFileObj, args.librarySettings, args.inputs, otherArguments)]; + case 4: + result = _a.sent(); + args.jobLog(JSON.stringify(result, null, 2)); + outputNumber = result.processFile ? 1 : 2; + return [2 /*return*/, { + outputFileObj: args.inputFileObj, + outputNumber: outputNumber, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/classic/runClassicTranscodePlugin/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/classic/runClassicTranscodePlugin/1.0.0/index.js new file mode 100644 index 0000000..f82d88b --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/classic/runClassicTranscodePlugin/1.0.0/index.js @@ -0,0 +1,262 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var cliUtils_1 = require("../../../../FlowHelpers/1.0.0/cliUtils"); +var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Run Classic Transcode Plugin', + description: 'Run one of Tdarr\'s classic plugins that has Operation: Transcode', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'pluginSourceId', + type: 'string', + defaultValue: 'Community:Tdarr_Plugin_MC93_Migz1FFMPEG', + inputUI: { + type: 'dropdown', + options: [], + }, + tooltip: 'Specify the classic plugin ID', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +var replaceContainer = function (filePath, container) { + var parts = filePath.split('.'); + parts[parts.length - 1] = container.split('.').join(''); + return parts.join('.'); +}; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var path, lib, pluginSourceId, parts, pluginSource, pluginId, relativePluginPath, absolutePath, classicPlugin, res_1, container, cacheFilePath, otherArguments, result, cliPath_1, customArgs, isCustomConfig, presetSplit, workerCommand, cliPath, cli, res; + var _a, _b, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + path = require('path'); + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + pluginSourceId = String(args.inputs.pluginSourceId); + parts = pluginSourceId.split(':'); + pluginSource = parts[0]; + pluginId = parts[1]; + relativePluginPath = "../../../../../".concat(pluginSource, "/").concat(pluginId, ".js"); + absolutePath = path.resolve(__dirname, relativePluginPath); + if (!(pluginSource === 'Community')) return [3 /*break*/, 1]; + classicPlugin = args.deps.importFresh(relativePluginPath); + return [3 /*break*/, 3]; + case 1: return [4 /*yield*/, args.deps.axiosMiddleware('api/v2/read-plugin', { + plugin: { + id: pluginId, + source: pluginSource, + }, + })]; + case 2: + res_1 = _d.sent(); + classicPlugin = args.deps.requireFromString(res_1.pluginRaw, absolutePath); + _d.label = 3; + case 3: + if (classicPlugin.details().Operation === 'Filter') { + throw new Error("".concat('This plugin is meant for classic plugins that have ' + + 'Operation: Transcode. This classic plugin has Operation: ').concat(classicPlugin.details().Operation) + + 'Please use the Run Classic Filter Flow Plugin plugin instead.'); + } + container = (0, fileUtils_1.getContainer)(args.inputFileObj._id); + cacheFilePath = "".concat(args.workDir, "/tempFile_").concat(new Date().getTime(), ".").concat(container); + otherArguments = { + handbrakePath: args.handbrakePath, + ffmpegPath: args.ffmpegPath, + mkvpropeditPath: args.mkvpropeditPath, + originalLibraryFile: args.originalLibraryFile, + nodeHardwareType: args.nodeHardwareType, + pluginCycle: 0, + workerType: args.workerType, + version: args.config.version, + platform_arch_isdocker: args.platform_arch_isdocker, + cacheFilePath: cacheFilePath, + job: args.job, + }; + return [4 /*yield*/, classicPlugin.plugin(args.inputFileObj, args.librarySettings, args.inputs, otherArguments)]; + case 4: + result = _d.sent(); + args.jobLog(JSON.stringify(result, null, 2)); + // --- Backwards compatibility------------ + if (result.handBrakeMode) { + result.handbrakeMode = result.handBrakeMode; + } + if (result.FFmpegMode) { + result.ffmpegMode = result.FFmpegMode; + } + //---------------------------------------- + if (result.ffmpegMode) { + result.cliToUse = 'ffmpeg'; + } + else if (result.handbrakeMode) { + result.cliToUse = 'handbrake'; + } + else if (typeof ((_a = result === null || result === void 0 ? void 0 : result.custom) === null || _a === void 0 ? void 0 : _a.cliPath) === 'string') { + cliPath_1 = result.custom.cliPath; + if (cliPath_1.toLowerCase().includes('ffmpeg')) { + result.cliToUse = 'ffmpeg'; + } + else if (cliPath_1.toLowerCase().includes('handbrake')) { + result.cliToUse = 'handbrake'; + } + else if (cliPath_1.toLowerCase().includes('editready')) { + result.cliToUse = 'editready'; + } + else if (cliPath_1.toLowerCase().includes('av1an')) { + result.cliToUse = 'av1an'; + } + } + result.workerLog = result.transcodeSettingsLog; + args.jobLog(JSON.stringify(result, null, 2)); + if (result.error) { + throw new Error("Plugin ".concat(absolutePath, " failed: ").concat(result.error)); + } + if (result.processFile !== true) { + return [2 /*return*/, { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }]; + } + customArgs = (_b = result === null || result === void 0 ? void 0 : result.custom) === null || _b === void 0 ? void 0 : _b.args; + isCustomConfig = (Array.isArray(customArgs) && customArgs.length > 0) + || (typeof customArgs === 'string' && customArgs.length > 0); + if (!isCustomConfig) { + cacheFilePath = replaceContainer(cacheFilePath, result.container); + } + else { + cacheFilePath = result.custom.outputPath; + } + if (result.preset.includes('')) { + presetSplit = result.preset.split(''); + } + else { + presetSplit = result.preset.split(','); + } + workerCommand = []; + cliPath = ''; + if (isCustomConfig) { + cliPath = (_c = result === null || result === void 0 ? void 0 : result.custom) === null || _c === void 0 ? void 0 : _c.cliPath; + if (Array.isArray(customArgs)) { + workerCommand = customArgs; + } + else { + workerCommand = __spreadArray([], args.deps.parseArgsStringToArgv(customArgs, '', ''), true); + } + } + else { + // working on windows with '` and spaces + // working on unix with ' + switch (true) { + case result.cliToUse === 'handbrake': + workerCommand = __spreadArray([ + '-i', + "".concat(args.inputFileObj._id), + '-o', + "".concat(cacheFilePath) + ], args.deps.parseArgsStringToArgv(result.preset, '', ''), true); + cliPath = "".concat(args.handbrakePath); + break; + case result.cliToUse === 'ffmpeg': + workerCommand = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], args.deps.parseArgsStringToArgv(presetSplit[0], '', ''), true), [ + '-i', + "".concat(args.inputFileObj._id) + ], false), args.deps.parseArgsStringToArgv(presetSplit[1], '', ''), true), [ + "".concat(cacheFilePath), + ], false); + cliPath = "".concat(args.ffmpegPath); + break; + default: + } + } + cli = new cliUtils_1.CLI({ + cli: cliPath, + spawnArgs: workerCommand, + spawnOpts: {}, + jobLog: args.jobLog, + outputFilePath: cacheFilePath, + inputFileObj: args.inputFileObj, + logFullCliOutput: args.logFullCliOutput, + updateWorker: args.updateWorker, + }); + return [4 /*yield*/, cli.runCli()]; + case 5: + res = _d.sent(); + if (res.cliExitCode !== 0) { + args.jobLog("Running ".concat(cliPath, " failed")); + throw new Error("Running ".concat(cliPath, " failed")); + } + args.logOutcome('tSuc'); + return [2 /*return*/, { + outputFileObj: { + _id: cacheFilePath, + }, + outputNumber: 1, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommand10BitVideo/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommand10BitVideo/1.0.0/index.js new file mode 100644 index 0000000..2650072 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommand10BitVideo/1.0.0/index.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: '10 Bit Video', + description: 'Set 10 Bit Video', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { + var stream = args.variables.ffmpegCommand.streams[i]; + if (stream.codec_type === 'video') { + stream.outputArgs.push('-pix_fmt:v:{outputTypeIndex}', 'p010le', '-profile:v:{outputTypeIndex}', 'main10'); + } + } + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCropBlackBars/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCropBlackBars/1.0.0/index.js new file mode 100644 index 0000000..af2727a --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCropBlackBars/1.0.0/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Crop Black Bars', + description: 'Crop Black Bars', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.js new file mode 100644 index 0000000..5f30691 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Custom Arguments', + description: 'Custom Arguments', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandEnsureAudioStream/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandEnsureAudioStream/1.0.0/index.js new file mode 100644 index 0000000..0808373 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandEnsureAudioStream/1.0.0/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Ensure Audio Stream', + description: 'Ensure that the file has an audio stream with set codec and channel count', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js new file mode 100644 index 0000000..28322e8 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js @@ -0,0 +1,193 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var cliUtils_1 = require("../../../../FlowHelpers/1.0.0/cliUtils"); +var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Execute', + description: 'Execute the created FFmpeg command', + style: { + borderColor: 'green', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: 2, + icon: 'faPlay', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +var getOuputStreamIndex = function (streams, stream) { + var index = -1; + for (var idx = 0; idx < streams.length; idx += 1) { + if (!stream.removed) { + index += 1; + } + if (streams[idx].index === stream.index) { + break; + } + } + return index; +}; +var getOuputStreamTypeIndex = function (streams, stream) { + var index = -1; + for (var idx = 0; idx < streams.length; idx += 1) { + if (!stream.removed && streams[idx].codec_type === stream.codec_type) { + index += 1; + } + if (streams[idx].index === stream.index) { + break; + } + } + return index; +}; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var lib, cliArgs, inputArgs, _a, shouldProcess, streams, _loop_1, i, idx, outputFilePath, cli, res; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + cliArgs = []; + cliArgs.push('-y'); + cliArgs.push('-i'); + cliArgs.push(args.inputFileObj._id); + inputArgs = []; + _a = args.variables.ffmpegCommand, shouldProcess = _a.shouldProcess, streams = _a.streams; + streams = streams.filter(function (stream) { + if (stream.removed) { + shouldProcess = true; + } + return !stream.removed; + }); + if ((0, fileUtils_1.getContainer)(args.inputFileObj._id) !== args.variables.ffmpegCommand.container) { + shouldProcess = true; + } + _loop_1 = function (i) { + var stream = streams[i]; + stream.outputArgs = stream.outputArgs.map(function (arg) { + if (arg.includes('{outputIndex}')) { + // eslint-disable-next-line no-param-reassign + arg = arg.replace('{outputIndex}', String(getOuputStreamIndex(streams, stream))); + } + if (arg.includes('{outputTypeIndex}')) { + // eslint-disable-next-line no-param-reassign + arg = arg.replace('{outputTypeIndex}', String(getOuputStreamTypeIndex(streams, stream))); + } + return arg; + }); + cliArgs.push.apply(cliArgs, stream.mapArgs); + if (stream.outputArgs.length === 0) { + cliArgs.push("-c:".concat(getOuputStreamIndex(streams, stream)), 'copy'); + } + else { + cliArgs.push.apply(cliArgs, stream.outputArgs); + } + inputArgs.push.apply(inputArgs, stream.inputArgs); + }; + for (i = 0; i < streams.length; i += 1) { + _loop_1(i); + } + if (!shouldProcess) { + args.jobLog('No need to process file, already as required'); + return [2 /*return*/, { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }]; + } + idx = cliArgs.indexOf('-i'); + cliArgs.splice.apply(cliArgs, __spreadArray([idx, 0], inputArgs, false)); + outputFilePath = "".concat(args.workDir, "/tempFile_").concat(new Date().getTime(), ".").concat(args.variables.ffmpegCommand.container); + cliArgs.push(outputFilePath); + args.jobLog('Processing file'); + args.jobLog(JSON.stringify({ + cliArgs: cliArgs, + outputFilePath: outputFilePath, + })); + args.updateWorker({ + CLIType: args.ffmpegPath, + preset: cliArgs.join(' '), + }); + cli = new cliUtils_1.CLI({ + cli: args.ffmpegPath, + spawnArgs: cliArgs, + spawnOpts: {}, + jobLog: args.jobLog, + outputFilePath: outputFilePath, + inputFileObj: args.inputFileObj, + logFullCliOutput: args.logFullCliOutput, + updateWorker: args.updateWorker, + }); + return [4 /*yield*/, cli.runCli()]; + case 1: + res = _b.sent(); + if (res.cliExitCode !== 0) { + args.jobLog('Running FFmpeg failed'); + throw new Error('FFmpeg failed'); + } + args.logOutcome('tSuc'); + return [2 /*return*/, { + outputFileObj: { + _id: outputFilePath, + }, + outputNumber: 1, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.js new file mode 100644 index 0000000..0f5bd42 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'HDR to SDR', + description: 'Convert HDR to SDR', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandNormalizeAudio/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandNormalizeAudio/1.0.0/index.js new file mode 100644 index 0000000..424b8fd --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandNormalizeAudio/1.0.0/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Normalize Audio', + description: 'Normalize Audio', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveDataStreams/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveDataStreams/1.0.0/index.js new file mode 100644 index 0000000..97b0d1c --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveDataStreams/1.0.0/index.js @@ -0,0 +1,41 @@ +"use strict"; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint-disable no-param-reassign */ +var details = function () { return ({ + name: 'Remove Data Streams', + description: 'Remove Data Streams ', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + args.variables.ffmpegCommand.streams.forEach(function (stream) { + if (stream.codec_type === 'data') { + stream.removed = true; + } + }); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveSubtitles/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveSubtitles/1.0.0/index.js new file mode 100644 index 0000000..7413f8e --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveSubtitles/1.0.0/index.js @@ -0,0 +1,41 @@ +"use strict"; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint-disable no-param-reassign */ +var details = function () { return ({ + name: 'Remove Subtitles', + description: 'Remove subtitles from the file', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + args.variables.ffmpegCommand.streams.forEach(function (stream) { + if (stream.codec_type === 'subtitle') { + stream.removed = true; + } + }); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRorderStreams/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRorderStreams/1.0.0/index.js new file mode 100644 index 0000000..54e675c --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRorderStreams/1.0.0/index.js @@ -0,0 +1,171 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Reorder Streams', + description: 'Reorder Streams', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'processOrder', + type: 'string', + defaultValue: 'codecs,channels,languages,streamTypes', + inputUI: { + type: 'text', + }, + tooltip: "Specify the process order.\nFor example, if 'languages' is first, the streams will be ordered based on that first.\nSo put the most important properties last.\nThe default order is suitable for most people.\n\n \\nExample:\\n\n codecs,channels,languages,streamTypes\n ", + }, + { + name: 'languages', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: "Specify the language tags order, separated by commas. Leave blank to disable.\n \\nExample:\\n\n eng,fre\n ", + }, + { + name: 'channels', + type: 'string', + defaultValue: '7.1,5.1,2,1', + inputUI: { + type: 'text', + }, + tooltip: "Specify the channels order, separated by commas. Leave blank to disable.\n \n \\nExample:\\n\n 7.1,5.1,2,1", + }, + { + name: 'codecs', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: "Specify the codec order, separated by commas. Leave blank to disable.\n \n \\nExample:\\n\n aac,ac3", + }, + { + name: 'streamTypes', + type: 'string', + defaultValue: 'video,audio,subtitle', + inputUI: { + type: 'text', + }, + tooltip: "Specify the streamTypes order, separated by commas. Leave blank to disable.\n \\nExample:\\n\n video,audio,subtitle\n ", + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var streams = JSON.parse(JSON.stringify(args.variables.ffmpegCommand.streams)); + var originalStreams = JSON.stringify(streams); + streams.forEach(function (stream, index) { + // eslint-disable-next-line no-param-reassign + stream.typeIndex = index; + }); + var sortStreams = function (sortType) { + var items = sortType.inputs.split(','); + items.reverse(); + for (var i = 0; i < items.length; i += 1) { + var matchedStreams = []; + for (var j = 0; j < streams.length; j += 1) { + if (String(sortType.getValue(streams[j])) === String(items[i])) { + if (streams[j].codec_long_name + && (streams[j].codec_long_name.includes('image') + || streams[j].codec_name.includes('png'))) { + // do nothing, ffmpeg bug, doesn't move image streams + } + else { + matchedStreams.push(streams[j]); + streams.splice(j, 1); + j -= 1; + } + } + } + streams = matchedStreams.concat(streams); + } + }; + var processOrder = String(args.inputs.processOrder); + var _a = args.inputs, languages = _a.languages, codecs = _a.codecs, channels = _a.channels, streamTypes = _a.streamTypes; + var sortTypes = { + languages: { + getValue: function (stream) { + var _a; + if ((_a = stream === null || stream === void 0 ? void 0 : stream.tags) === null || _a === void 0 ? void 0 : _a.language) { + return stream.tags.language; + } + return ''; + }, + inputs: languages, + }, + codecs: { + getValue: function (stream) { + try { + return stream.codec_name; + } + catch (err) { + // err + } + return ''; + }, + inputs: codecs, + }, + channels: { + getValue: function (stream) { + var chanMap = { + 8: '7.1', + 6: '5.1', + 2: '2', + 1: '1', + }; + if ((stream === null || stream === void 0 ? void 0 : stream.channels) && chanMap[stream.channels]) { + return chanMap[stream.channels]; + } + return ''; + }, + inputs: channels, + }, + streamTypes: { + getValue: function (stream) { + if (stream.codec_type) { + return stream.codec_type; + } + return ''; + }, + inputs: streamTypes, + }, + }; + var processOrderArr = processOrder.split(','); + for (var k = 0; k < processOrderArr.length; k += 1) { + if (sortTypes[processOrderArr[k]] && sortTypes[processOrderArr[k]].inputs) { + sortStreams(sortTypes[processOrderArr[k]]); + } + } + if (JSON.stringify(streams) !== originalStreams) { + // eslint-disable-next-line no-param-reassign + args.variables.ffmpegCommand.shouldProcess = true; + // eslint-disable-next-line no-param-reassign + args.variables.ffmpegCommand.streams = streams; + } + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.js new file mode 100644 index 0000000..a655e4b --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.js @@ -0,0 +1,51 @@ +"use strict"; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint-disable no-param-reassign */ +var details = function () { return ({ + name: 'Set Container', + description: 'Set the container of the output file', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'container', + type: 'string', + defaultValue: 'mkv', + inputUI: { + type: 'dropdown', + options: [ + 'mkv', + 'mp4', + ], + }, + tooltip: 'Specify the container to use', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + args.variables.ffmpegCommand.container = String(args.inputs.container); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVdeoResolution/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVdeoResolution/1.0.0/index.js new file mode 100644 index 0000000..9295b98 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVdeoResolution/1.0.0/index.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Set Video Resolution', + description: 'Change video resolution', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'targetResolution', + type: 'string', + defaultValue: '1080p', + inputUI: { + type: 'dropdown', + options: [ + '480p', + '720p', + '1080p', + '1440p', + '4KUHD', + ], + }, + tooltip: 'Specify the codec to use', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +var getVfScale = function (targetResolution) { + switch (targetResolution) { + case '480p': + return ['-vf', 'scale=720:-2']; + case '576p': + return ['-vf', 'scale=720:-2']; + case '720p': + return ['-vf', 'scale=1280:-2']; + case '1080p': + return ['-vf', 'scale=1920:-2']; + case '1440p': + return ['-vf', 'scale=2560:-2']; + case '4KUHD': + return ['-vf', 'scale=3840:-2']; + default: + return ['-vf', 'scale=1920:-2']; + } +}; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var _a; + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { + var stream = args.variables.ffmpegCommand.streams[i]; + if (stream.codec_type === 'video') { + var targetResolution = String(args.inputs.targetResolution); + if (targetResolution !== args.inputFileObj.video_resolution) { + // eslint-disable-next-line no-param-reassign + args.variables.ffmpegCommand.shouldProcess = true; + var scaleArgs = getVfScale(targetResolution); + (_a = stream.outputArgs).push.apply(_a, scaleArgs); + } + } + } + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoBitrate/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoBitrate/1.0.0/index.js new file mode 100644 index 0000000..61e49e3 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoBitrate/1.0.0/index.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Set Video Bitrate', + description: 'Set Video Bitrate', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'bitrate', + type: 'string', + defaultValue: '5000', + inputUI: { + type: 'text', + }, + tooltip: 'Specify bitrate in kbps', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + args.variables.ffmpegCommand.streams.forEach(function (stream) { + if (stream.codec_type === 'video') { + var ffType = (0, fileUtils_1.getFfType)(stream.codec_type); + stream.outputArgs.push("-b:".concat(ffType, ":{outputTypeIndex}"), "".concat(String(args.inputs.bitrate), "k")); + } + }); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js new file mode 100644 index 0000000..411a2ca --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.js @@ -0,0 +1,207 @@ +"use strict"; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var hardwareUtils_1 = require("../../../../FlowHelpers/1.0.0/hardwareUtils"); +/* eslint-disable no-param-reassign */ +var details = function () { return ({ + name: 'Set Video Encoder', + description: 'Set the video encoder for all streams', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'outputCodec', + type: 'string', + defaultValue: 'hevc', + inputUI: { + type: 'dropdown', + options: [ + 'hevc', + // 'vp9', + 'h264', + // 'vp8', + ], + }, + tooltip: 'Specify the codec to use', + }, + { + name: 'ffmpegPreset', + type: 'string', + defaultValue: 'fast', + inputUI: { + type: 'dropdown', + options: [ + 'veryslow', + 'slower', + 'slow', + 'medium', + 'fast', + 'faster', + 'veryfast', + 'superfast', + 'ultrafast', + ], + }, + tooltip: 'Specify the codec to use', + }, + { + name: 'ffmpegQuality', + type: 'number', + defaultValue: '25', + inputUI: { + type: 'text', + }, + tooltip: 'Specify the codec to use', + }, + { + name: 'hardwareEncoding', + type: 'boolean', + defaultValue: 'true', + inputUI: { + type: 'dropdown', + options: [ + 'false', + 'true', + ], + }, + tooltip: 'Specify whether to use hardware encoding if available', + }, + { + name: 'hardwareDecoding', + type: 'boolean', + defaultValue: 'true', + inputUI: { + type: 'dropdown', + options: [ + 'false', + 'true', + ], + }, + tooltip: 'Specify whether to use hardware decoding if available', + }, + { + name: 'forceEncoding', + type: 'boolean', + defaultValue: 'false', + inputUI: { + type: 'dropdown', + options: [ + 'false', + 'true', + ], + }, + tooltip: 'Specify whether to force encoding if stream already has the target codec', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var lib, hardwareDecoding, i, stream, targetCodec, ffmpegPreset, ffmpegQuality, forceEncoding, hardwarEncoding, encoderProperties; + var _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + hardwareDecoding = args.inputs.hardwareDecoding === true; + args.variables.ffmpegCommand.hardwareDecoding = hardwareDecoding; + i = 0; + _c.label = 1; + case 1: + if (!(i < args.variables.ffmpegCommand.streams.length)) return [3 /*break*/, 4]; + stream = args.variables.ffmpegCommand.streams[i]; + if (!(stream.codec_type === 'video')) return [3 /*break*/, 3]; + targetCodec = String(args.inputs.outputCodec); + ffmpegPreset = String(args.inputs.ffmpegPreset); + ffmpegQuality = String(args.inputs.ffmpegQuality); + forceEncoding = args.inputs.forceEncoding === true; + hardwarEncoding = args.inputs.hardwareEncoding === true; + if (!(forceEncoding + || stream.codec_name !== targetCodec)) return [3 /*break*/, 3]; + args.variables.ffmpegCommand.shouldProcess = true; + return [4 /*yield*/, (0, hardwareUtils_1.getEncoder)({ + targetCodec: targetCodec, + hardwareEncoding: hardwarEncoding, + args: args, + })]; + case 2: + encoderProperties = _c.sent(); + stream.outputArgs.push('-c:{outputIndex}', encoderProperties.encoder); + if (encoderProperties.isGpu) { + stream.outputArgs.push('-qp', ffmpegQuality); + } + else { + stream.outputArgs.push('-crf', ffmpegQuality); + } + if (ffmpegPreset) { + stream.outputArgs.push('-preset', ffmpegPreset); + } + if (hardwareDecoding) { + (_a = stream.inputArgs).push.apply(_a, encoderProperties.inputArgs); + } + if (encoderProperties.outputArgs) { + (_b = stream.outputArgs).push.apply(_b, encoderProperties.outputArgs); + } + _c.label = 3; + case 3: + i += 1; + return [3 /*break*/, 1]; + case 4: return [2 /*return*/, { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandStart/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandStart/1.0.0/index.js new file mode 100644 index 0000000..206acdf --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandStart/1.0.0/index.js @@ -0,0 +1,62 @@ +"use strict"; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint-disable no-param-reassign */ +var details = function () { return ({ + name: 'Start', + description: 'Start FFmpeg Command', + style: { + borderColor: 'green', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: 1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var containerParts = args.inputFileObj._id.split('.'); + var container = containerParts[containerParts.length - 1]; + var ffmpegCommand = { + inputFiles: [], + streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map(function (stream) { return (__assign(__assign({}, stream), { removed: false, mapArgs: [ + '-map', + "0:".concat(stream.index), + ], inputArgs: [], outputArgs: [] })); }), + container: container, + hardwareDecoding: false, + shouldProcess: false, + overallInputArguments: [], + overallOuputArguments: [], + }; + args.variables.ffmpegCommand = ffmpegCommand; + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/checkFileExtension/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/checkFileExtension/1.0.0/index.js new file mode 100644 index 0000000..72f6c60 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/checkFileExtension/1.0.0/index.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Check File Extension', + description: 'Check file extension', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'extensions', + type: 'string', + defaultValue: 'mkv,mp4', + inputUI: { + type: 'text', + }, + tooltip: 'A comma separated list of extensions to check', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File is one of extensions', + }, + { + number: 2, + tooltip: 'File is not one of extensions', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var extensions = String(args.inputs.extensions); + var extensionArray = extensions.trim().split(','); + var extension = (0, fileUtils_1.getContainer)(args.inputFileObj._id); + var extensionMatch = false; + if (extensionArray.includes(extension)) { + extensionMatch = true; + } + return { + outputFileObj: args.inputFileObj, + outputNumber: extensionMatch ? 1 : 2, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/checkFileMedium/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/checkFileMedium/1.0.0/index.js new file mode 100644 index 0000000..7f0c9ec --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/checkFileMedium/1.0.0/index.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Check File Medium', + description: 'Check if file is video, audio or other type of file', + style: { + borderColor: 'orange', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'File medium is a Video', + }, + { + number: 2, + tooltip: 'File medium is an Audio', + }, + { + number: 3, + tooltip: 'File medium is Other', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var outputNumber = 1; + switch (args.inputFileObj.fileMedium) { + case 'video': + outputNumber = 1; + break; + case 'audio': + outputNumber = 2; + break; + case 'other': + outputNumber = 3; + break; + default: + throw new Error('File has no fileMedium!'); + } + return { + outputFileObj: args.inputFileObj, + outputNumber: outputNumber, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/checkFileSize/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/checkFileSize/1.0.0/index.js new file mode 100644 index 0000000..620c13b --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/checkFileSize/1.0.0/index.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Check File Size', + description: 'Check size of working file', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'unit', + type: 'string', + defaultValue: 'GB', + inputUI: { + type: 'dropdown', + options: [ + 'B', + 'KB', + 'MB', + 'GB', + ], + }, + tooltip: 'Specify the unit to use', + }, + { + name: 'greaterThan', + type: 'number', + defaultValue: '0', + inputUI: { + type: 'text', + }, + tooltip: 'Specify lower bound', + }, + { + name: 'lessThan', + type: 'number', + defaultValue: '10000', + inputUI: { + type: 'text', + }, + tooltip: 'Specify upper bound', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File within range', + }, + { + number: 2, + tooltip: 'File not within range', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var isWithinRange = false; + var greaterThanBytes = Number(args.inputs.greaterThan); + var lessThanBytes = Number(args.inputs.lessThan); + var fileSizeBytes = args.inputFileObj.file_size * 1000 * 1000; + if (args.inputs.unit === 'KB') { + greaterThanBytes *= 1000; + lessThanBytes *= 1000; + } + else if (args.inputs.unit === 'MB') { + greaterThanBytes *= 1000000; + lessThanBytes *= 1000000; + } + else if (args.inputs.unit === 'GB') { + greaterThanBytes *= 1000000000; + lessThanBytes *= 1000000000; + } + if (fileSizeBytes >= greaterThanBytes && fileSizeBytes <= lessThanBytes) { + isWithinRange = true; + } + return { + outputFileObj: args.inputFileObj, + outputNumber: isWithinRange ? 1 : 2, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/compareFileSize/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/compareFileSize/1.0.0/index.js new file mode 100644 index 0000000..dfbf12e --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/compareFileSize/1.0.0/index.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Compare File Size', + description: 'Compare file size of working file compared to original file', + style: { + borderColor: 'orange', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Working file is smaller than original file', + }, + { + number: 2, + tooltip: 'Working file is same size as original file', + }, + { + number: 3, + tooltip: 'Working file is larger than original file', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var outputNumber = 1; + if (args.inputFileObj.file_size < args.originalLibraryFile.file_size) { + outputNumber = 1; + } + else if (args.inputFileObj.file_size === args.originalLibraryFile.file_size) { + outputNumber = 2; + } + else if (args.inputFileObj.file_size > args.originalLibraryFile.file_size) { + outputNumber = 3; + } + return { + outputFileObj: args.inputFileObj, + outputNumber: outputNumber, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/copyToDirectory/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/copyToDirectory/1.0.0/index.js new file mode 100644 index 0000000..5440e3e --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/copyToDirectory/1.0.0/index.js @@ -0,0 +1,114 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var fs_1 = require("fs"); +var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Copy to Directory', + description: 'Copy the working file to a directory', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [ + { + name: 'outputDirectory', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Specify ouput directory', + }, + { + name: 'makeWorkingFile', + type: 'boolean', + defaultValue: 'false', + inputUI: { + type: 'text', + options: [ + 'false', + 'true', + ], + }, + tooltip: 'Make the copied file the working file', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var lib, originalFileName, newContainer, outputPath, workingFile; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + originalFileName = (0, fileUtils_1.getFileName)(args.originalLibraryFile._id); + newContainer = (0, fileUtils_1.getContainer)(args.inputFileObj._id); + outputPath = "".concat(args.inputs.outputDirectory, "/").concat(originalFileName, ".").concat(newContainer); + return [4 /*yield*/, fs_1.promises.copyFile(args.inputFileObj._id, outputPath)]; + case 1: + _a.sent(); + workingFile = args.inputFileObj._id; + if (args.inputs.makeWorkingFile) { + workingFile = outputPath; + } + return [2 /*return*/, { + outputFileObj: { + _id: workingFile, + }, + outputNumber: 1, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/moveToDirectory/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/moveToDirectory/1.0.0/index.js new file mode 100644 index 0000000..7525c8f --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/moveToDirectory/1.0.0/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Move To Directory', + description: 'Move working file to directory.', + style: { + borderColor: 'green', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/moveToDirectory/2.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/moveToDirectory/2.0.0/index.js new file mode 100644 index 0000000..6cab7e2 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/moveToDirectory/2.0.0/index.js @@ -0,0 +1,97 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var fs_1 = require("fs"); +var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Move To Directory', + description: 'Move working file to directory.', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [ + { + name: 'outputDirectory', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Specify ouput directory', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var lib, originalFileName, newContainer, outputPath; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + originalFileName = (0, fileUtils_1.getFileName)(args.originalLibraryFile._id); + newContainer = (0, fileUtils_1.getContainer)(args.inputFileObj._id); + outputPath = "".concat(args.inputs.outputDirectory, "/").concat(originalFileName, ".").concat(newContainer); + return [4 /*yield*/, fs_1.promises.rename(args.inputFileObj._id, outputPath)]; + case 1: + _a.sent(); + return [2 /*return*/, { + outputFileObj: { + _id: outputPath, + }, + outputNumber: 1, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/replaceOriginalFile/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/replaceOriginalFile/1.0.0/index.js new file mode 100644 index 0000000..5adc035 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/replaceOriginalFile/1.0.0/index.js @@ -0,0 +1,106 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Replace Original File', + description: 'Replace the original file', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +var getNewPath = function (originalPath, tempPath) { + var tempPathParts = tempPath.split('.'); + var container = tempPathParts[tempPathParts.length - 1]; + var originalPathParts = originalPath.split('.'); + originalPathParts[originalPathParts.length - 1] = container; + return originalPathParts.join('.'); +}; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var fs, lib, currentPath, newPath, newPathTmp; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + fs = require('fs'); + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + currentPath = args.inputFileObj._id; + newPath = getNewPath(args.originalLibraryFile._id, currentPath); + newPathTmp = "".concat(newPath, ".tmp"); + args.jobLog(JSON.stringify({ + currentPath: currentPath, + newPath: newPath, + newPathTmp: newPathTmp, + })); + return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })]; + case 1: + _a.sent(); + fs.renameSync(currentPath, newPathTmp); + if (fs.existsSync(newPath)) { + fs.unlinkSync(newPath); + } + return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 2000); })]; + case 2: + _a.sent(); + fs.renameSync(newPathTmp, newPath); + return [2 /*return*/, { + outputFileObj: { + _id: newPath, + }, + outputNumber: 1, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/setOriginalFile/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/setOriginalFile/1.0.0/index.js new file mode 100644 index 0000000..1ca5b52 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/setOriginalFile/1.0.0/index.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Set Original File', + description: 'Set the working file to the original file', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: { + _id: args.originalLibraryFile._id, + }, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/file/unpack/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/file/unpack/1.0.0/index.js new file mode 100644 index 0000000..a6210f3 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/file/unpack/1.0.0/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Unpack File', + description: 'Unpack a file', + style: { + borderColor: 'green', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/handbrake/handbrakeCustomArguments/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/handbrake/handbrakeCustomArguments/1.0.0/index.js new file mode 100644 index 0000000..e10d1eb --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/handbrake/handbrakeCustomArguments/1.0.0/index.js @@ -0,0 +1,165 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var fs_1 = require("fs"); +var cliUtils_1 = require("../../../../FlowHelpers/1.0.0/cliUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'HandBrake Custom Arguments', + description: 'HandBrake Custom Arguments', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'customArguments', + type: 'string', + defaultValue: '-Z "Fast 1080p30" --all-subtitles', + inputUI: { + type: 'text', + }, + tooltip: 'Specify HandBrake arguments', + }, + { + name: 'jsonPreset', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Paste a HandBrake JSON preset here. Leave blank to disable.', + }, + { + name: 'container', + type: 'string', + defaultValue: 'mkv', + inputUI: { + type: 'dropdown', + options: [ + 'mkv', + 'mp4', + 'm4v', + 'avi', + 'mov', + 'mpg', + 'mpeg', + ], + }, + tooltip: 'Specify HandBrake arguments', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var lib, customArguments, container, outputFilePath, presetString, cliArgs, presetPath, preset, cli, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + customArguments = String(args.inputs.customArguments); + container = String(args.inputs.container); + outputFilePath = "".concat(args.workDir, "/tempFile_").concat(new Date().getTime(), ".").concat(container); + presetString = String(args.inputs.jsonPreset); + cliArgs = [ + '-i', + "".concat(args.inputFileObj._id), + '-o', + "".concat(outputFilePath), + ]; + presetPath = "".concat(args.workDir, "/preset.json"); + if (!(presetString.trim() !== '')) return [3 /*break*/, 2]; + preset = JSON.parse(presetString); + return [4 /*yield*/, fs_1.promises.writeFile(presetPath, JSON.stringify(preset, null, 2))]; + case 1: + _a.sent(); + cliArgs.push('--preset-import-file'); + cliArgs.push(presetPath); + cliArgs.push('-Z'); + cliArgs.push(preset.PresetList[0].PresetName); + return [3 /*break*/, 3]; + case 2: + cliArgs.push.apply(cliArgs, args.deps.parseArgsStringToArgv(customArguments, '', '')); + _a.label = 3; + case 3: + args.updateWorker({ + CLIType: args.handbrakePath, + preset: cliArgs.join(' '), + }); + cli = new cliUtils_1.CLI({ + cli: args.handbrakePath, + spawnArgs: cliArgs, + spawnOpts: {}, + jobLog: args.jobLog, + outputFilePath: outputFilePath, + inputFileObj: args.inputFileObj, + logFullCliOutput: args.logFullCliOutput, + updateWorker: args.updateWorker, + }); + return [4 /*yield*/, cli.runCli()]; + case 4: + res = _a.sent(); + if (res.cliExitCode !== 0) { + args.jobLog('Running HandBrake failed'); + throw new Error('Running HandBrake failed'); + } + args.logOutcome('tSuc'); + return [2 /*return*/, { + outputFileObj: { + _id: outputFilePath, + }, + outputNumber: 1, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/input/inputFile/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/input/inputFile/1.0.0/index.js new file mode 100644 index 0000000..6f3fd72 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/input/inputFile/1.0.0/index.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Input File', + description: 'Start the flow with an input file', + style: { + borderColor: 'pink', + }, + tags: '', + isStartPlugin: true, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/tools/failFlow/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/failFlow/1.0.0/index.js new file mode 100644 index 0000000..2572c7f --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/tools/failFlow/1.0.0/index.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Fail Flow', + description: 'Force the flow to fail and be move to the error table', + style: { + borderColor: 'red', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faExclamationTriangle', + inputs: [], + outputs: [], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + throw new Error('Forcing flow to fail!'); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/tools/goToFlow/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/goToFlow/1.0.0/index.js new file mode 100644 index 0000000..88560da --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/tools/goToFlow/1.0.0/index.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Go To Flow', + description: 'Go to a different flow', + style: { + borderColor: 'red', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [], + outputs: [], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/tools/runMkvPropEdit/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/runMkvPropEdit/1.0.0/index.js new file mode 100644 index 0000000..d39a608 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/tools/runMkvPropEdit/1.0.0/index.js @@ -0,0 +1,100 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +var cliUtils_1 = require("../../../../FlowHelpers/1.0.0/cliUtils"); +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Run MKVPropEdit', + description: 'Run MKVPropEdit on a file to update metadata which' + + ' FFmpeg doesn\'t typically update such as stream bitrate.', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () { + var lib, cliArgs, cli, res; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + cliArgs = [ + '--add-track-statistics-tags', + args.inputFileObj._id, + ]; + cli = new cliUtils_1.CLI({ + cli: args.mkvpropeditPath, + spawnArgs: cliArgs, + spawnOpts: {}, + jobLog: args.jobLog, + outputFilePath: '', + inputFileObj: args.inputFileObj, + logFullCliOutput: args.logFullCliOutput, + updateWorker: args.updateWorker, + }); + return [4 /*yield*/, cli.runCli()]; + case 1: + res = _a.sent(); + if (res.cliExitCode !== 0) { + args.jobLog('Running MKVPropEdit failed'); + throw new Error('Running MKVPropEdit failed'); + } + return [2 /*return*/, { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }]; + } + }); +}); }; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js new file mode 100644 index 0000000..00f6e8b --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/tools/webRequest/1.0.0/index.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Send Web Request', + description: 'Send Web Request', + style: { + borderColor: 'green', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/video/check10Bit/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/check10Bit/1.0.0/index.js new file mode 100644 index 0000000..d436e35 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/video/check10Bit/1.0.0/index.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Check 10 Bit Video', + description: 'Check if a file is 10 bit video', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'File is 10 bit video', + }, + { + number: 2, + tooltip: 'File is not 10 bit video', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var is10Bit = false; + for (var i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { + var stream = args.variables.ffmpegCommand.streams[i]; + if (stream.codec_type === 'video' && stream.bits_per_raw_sample === 10) { + is10Bit = true; + } + } + return { + outputFileObj: args.inputFileObj, + outputNumber: is10Bit ? 1 : 2, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/video/checkVideoBitrate/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/checkVideoBitrate/1.0.0/index.js new file mode 100644 index 0000000..64f9bf9 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/video/checkVideoBitrate/1.0.0/index.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Check Video Bitrate', + description: 'Check if video bitrate is within a specific range', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'unit', + type: 'string', + defaultValue: 'kbps', + inputUI: { + type: 'dropdown', + options: [ + 'bps', + 'kbps', + 'mbps', + ], + }, + tooltip: 'Specify the unit to use', + }, + { + name: 'greaterThan', + type: 'number', + defaultValue: '0', + inputUI: { + type: 'text', + }, + tooltip: 'Specify lower bound', + }, + { + name: 'lessThan', + type: 'number', + defaultValue: '10000', + inputUI: { + type: 'text', + }, + tooltip: 'Specify upper bound', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File within range', + }, + { + number: 2, + tooltip: 'File not within range', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var _a, _b; + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var isWithinRange = false; + var greaterThanBits = Number(args.inputs.greaterThan); + var lessThanBits = Number(args.inputs.lessThan); + if (args.inputs.unit === 'kbps') { + greaterThanBits *= 1000; + lessThanBits *= 1000; + } + else if (args.inputs.unit === 'mbps') { + greaterThanBits *= 1000000; + lessThanBits *= 1000000; + } + if ((_b = (_a = args.inputFileObj) === null || _a === void 0 ? void 0 : _a.mediaInfo) === null || _b === void 0 ? void 0 : _b.track) { + args.inputFileObj.mediaInfo.track.forEach(function (stream) { + if (stream['@type'] === 'video') { + if (stream.BitRate >= greaterThanBits && stream.BitRate <= lessThanBits) { + isWithinRange = true; + } + } + }); + } + return { + outputFileObj: args.inputFileObj, + outputNumber: isWithinRange ? 1 : 2, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/video/checkVideoCodec/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/checkVideoCodec/1.0.0/index.js new file mode 100644 index 0000000..e245b74 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/video/checkVideoCodec/1.0.0/index.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Check Video Codec', + description: 'Check if a file has a specific video codec', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'codec', + type: 'string', + defaultValue: 'hevc', + inputUI: { + type: 'dropdown', + options: [ + 'hevc', + 'vp9', + 'h264', + 'vp8', + ], + }, + tooltip: 'Specify the codec check for', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File has codec', + }, + { + number: 2, + tooltip: 'File does not have codec', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var hasCodec = false; + if (args.inputFileObj.ffProbeData.streams) { + args.inputFileObj.ffProbeData.streams.forEach(function (stream) { + if (stream.codec_type === 'video' && stream.codec_name === args.inputs.codec) { + hasCodec = true; + } + }); + } + return { + outputFileObj: args.inputFileObj, + outputNumber: hasCodec ? 1 : 2, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/video/checkVideoResolution/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/checkVideoResolution/1.0.0/index.js new file mode 100644 index 0000000..bdbcfb2 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/video/checkVideoResolution/1.0.0/index.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Check Video Resolution', + description: 'Check is video is 480p,576p,720p,1080p,1440p,4KUHD,DCI4K,8KUHD,Other', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'File is 480p', + }, + { + number: 2, + tooltip: 'File is 576p', + }, + { + number: 3, + tooltip: 'File is 720p', + }, + { + number: 4, + tooltip: 'File is 1080p', + }, + { + number: 5, + tooltip: 'File is 1440p', + }, + { + number: 6, + tooltip: 'File is 4KUHD', + }, + { + number: 7, + tooltip: 'File is DCI4K', + }, + { + number: 8, + tooltip: 'File is 8KUHD', + }, + { + number: 9, + tooltip: 'File is Other', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.js new file mode 100644 index 0000000..8a3a2cf --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = exports.details = void 0; +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +var details = function () { return ({ + name: 'Transcode Video File', + description: 'Transcode a video file using ffmpeg. GPU transcoding will be used if possible.', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'target_codec', + type: 'string', + defaultValue: 'hevc', + inputUI: { + type: 'dropdown', + options: [ + 'hevc', + // 'vp9', + 'h264', + // 'vp8', + ], + }, + tooltip: 'Specify the codec to use', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); }; +exports.details = details; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +var plugin = function (args) { + var lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + var fs = require('fs'); + var oldFile = args.inputFileObj._id; + var newFile = "".concat(args.inputFileObj._id, ".tmp"); + if (fs.existsSync(newFile)) { + fs.unlinkSync(newFile); + } + fs.copyFileSync(oldFile, newFile); + return { + outputFileObj: { _id: newFile }, + outputNumber: 1, + variables: args.variables, + }; +}; +exports.plugin = plugin; diff --git a/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/test.js b/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/test.js new file mode 100644 index 0000000..3918c74 --- /dev/null +++ b/FlowPlugins/CommunityFlowPlugins/video/transcodeVideo/1.0.0/test.js @@ -0,0 +1 @@ +"use strict"; diff --git a/FlowPlugins/CommunityFlowTemplates/video/basicVideo.js b/FlowPlugins/CommunityFlowTemplates/video/basicVideo.js new file mode 100644 index 0000000..1dd64af --- /dev/null +++ b/FlowPlugins/CommunityFlowTemplates/video/basicVideo.js @@ -0,0 +1,131 @@ +"use strict"; +var details = function () { return ({ + name: 'Basic HEVC Video Flow', + description: 'Flow description', + tags: 'video', + flowPlugins: [ + { + name: 'Input File', + sourceRepo: 'Community', + pluginName: 'inputFile', + version: '1.0.0', + id: 'pE6rU7gkW', + position: { + x: 758.5809635618224, + y: 117.19206188888086, + }, + }, + { + name: 'Check if hevc', + sourceRepo: 'Community', + pluginName: 'checkVideoCodec', + version: '1.0.0', + id: '91b7IrsEc', + position: { + x: 672.4549563302081, + y: 253.11148102973914, + }, + }, + { + name: 'Start', + sourceRepo: 'Community', + pluginName: 'ffmpegCommandStart', + version: '1.0.0', + id: '4Swd6qzvc', + position: { + x: 499.4549563302081, + y: 367.1114810297392, + }, + }, + { + name: 'Execute', + sourceRepo: 'Community', + pluginName: 'ffmpegCommandExecute', + version: '1.0.0', + id: '450g167D8', + position: { + x: 496.4549563302081, + y: 653.1114810297393, + }, + }, + { + name: 'Set Video Encoder', + sourceRepo: 'Community', + pluginName: 'ffmpegCommandSetVideoEncoder', + version: '1.0.0', + id: '8B_6pRd_U', + position: { + x: 498.4549563302081, + y: 527.1114810297393, + }, + }, + { + name: 'Replace Original File', + sourceRepo: 'Community', + pluginName: 'replaceOriginalFile', + version: '1.0.0', + id: '4fkfOyR3l', + position: { + x: 820.4549563302082, + y: 742.2114810297393, + }, + }, + ], + flowEdges: [ + { + source: 'pE6rU7gkW', + sourceHandle: '1', + target: '91b7IrsEc', + targetHandle: null, + id: 'HhF4rw2DZ', + animated: true, + type: 'smoothstep', + }, + { + source: '91b7IrsEc', + sourceHandle: '2', + target: '4Swd6qzvc', + targetHandle: null, + id: 'jJizyFUcr', + animated: true, + type: 'smoothstep', + }, + { + source: '4Swd6qzvc', + sourceHandle: '1', + target: '8B_6pRd_U', + targetHandle: null, + id: '3Df7Xoy93', + animated: true, + type: 'smoothstep', + }, + { + source: '8B_6pRd_U', + sourceHandle: '1', + target: '450g167D8', + targetHandle: null, + id: 'BQerEKase', + animated: true, + type: 'smoothstep', + }, + { + source: '450g167D8', + sourceHandle: '1', + target: '4fkfOyR3l', + targetHandle: null, + id: 'rE5Dsh9KM', + animated: true, + type: 'smoothstep', + }, + { + source: '91b7IrsEc', + sourceHandle: '1', + target: '4fkfOyR3l', + targetHandle: null, + id: 'W2nVG7ts5', + animated: true, + type: 'smoothstep', + }, + ], +}); }; +module.exports.details = details; diff --git a/FlowPlugins/FlowHelpers/1.0.0/cliParsers.js b/FlowPlugins/FlowHelpers/1.0.0/cliParsers.js new file mode 100644 index 0000000..ee72a82 --- /dev/null +++ b/FlowPlugins/FlowHelpers/1.0.0/cliParsers.js @@ -0,0 +1,145 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.editreadyParser = exports.getFFmpegVar = exports.getFFmpegPercentage = exports.ffmpegParser = exports.handbrakeParser = void 0; +var handbrakeParser = function (_a) { + var str = _a.str; + if (typeof str !== 'string') { + return 0; + } + var percentage = 0; + var numbers = '0123456789'; + var n = str.indexOf('%'); + if (str.length >= 6 + && str.indexOf('%') >= 6 + && numbers.includes(str.charAt(n - 5))) { + var output = str.substring(n - 6, n + 1); + var outputArr = output.split(''); + outputArr.splice(outputArr.length - 1, 1); + output = outputArr.join(''); + var outputNum = Number(output); + if (outputNum > 0) { + percentage = outputNum; + } + } + return percentage; +}; +exports.handbrakeParser = handbrakeParser; +// frame= 889 fps=106 q=26.0 Lsize= 25526kB time=00:00:35.69 bitrate=5858.3kbits/s speed=4.25x +var getFFmpegVar = function (_a) { + var str = _a.str, variable = _a.variable; + if (typeof str !== 'string') { + return ''; + } + var idx = str.indexOf(variable); + var out = ''; + var initSpacesEnded = false; + if (idx >= 0) { + var startIdx = idx + variable.length + 1; + for (var i = startIdx; i < str.length; i += 1) { + if (initSpacesEnded === true && str[i] === ' ') { + break; + } + else if (initSpacesEnded === false && str[i] !== ' ') { + initSpacesEnded = true; + } + if (initSpacesEnded === true && str[i] !== ' ') { + out += str[i]; + } + } + } + return out; +}; +exports.getFFmpegVar = getFFmpegVar; +var getFFmpegPercentage = function (_a) { + var f = _a.f, fc = _a.fc, vf = _a.vf, d = _a.d; + var frameCount01 = fc; + var VideoFrameRate = vf; + var Duration = d; + var perc = 0; + var frame = parseInt(f, 10); + frameCount01 = Math.ceil(frameCount01); + VideoFrameRate = Math.ceil(VideoFrameRate); + Duration = Math.ceil(Duration); + if (frameCount01 > 0) { + perc = ((frame / frameCount01) * 100); + } + else if (VideoFrameRate > 0 && Duration > 0) { + perc = ((frame / (VideoFrameRate * Duration)) * 100); + } + else { + perc = (frame); + } + var percString = perc.toFixed(2); + // eslint-disable-next-line no-restricted-globals + if (isNaN(perc)) { + return 0.00; + } + return parseFloat(percString); +}; +exports.getFFmpegPercentage = getFFmpegPercentage; +var ffmpegParser = function (_a) { + var str = _a.str, frameCount = _a.frameCount, videoFrameRate = _a.videoFrameRate, ffprobeDuration = _a.ffprobeDuration, metaDuration = _a.metaDuration; + if (typeof str !== 'string') { + return 0; + } + var percentage = 0; + if (str.length >= 6) { + var n = str.indexOf('fps'); + if (n >= 6) { + // get frame + var frame = getFFmpegVar({ + str: str, + variable: 'frame', + }); + var frameRate = videoFrameRate || 0; + var duration = 0; + if (ffprobeDuration + && parseFloat(ffprobeDuration) > 0) { + duration = parseFloat(ffprobeDuration); + } + else if (metaDuration) { + duration = metaDuration; + } + var per = getFFmpegPercentage({ + f: frame, + fc: frameCount, + vf: frameRate, + d: duration, + }); + var outputNum = Number(per); + if (outputNum > 0) { + percentage = outputNum; + } + } + } + return percentage; +}; +exports.ffmpegParser = ffmpegParser; +var editreadyParser = function (_a) { + var str = _a.str; + if (typeof str !== 'string') { + return 0; + } + var percentage = 0; + // const ex = 'STATUS: {"progress": "0.0000000"}'; + if (str.includes('STATUS:')) { + var parts = str.split('STATUS:'); + if (parts[1]) { + try { + var json = JSON.parse(parts[1]); + var progress = parseFloat(json.progress); + var percStr = (progress * 100).toFixed(2); + percentage = parseFloat(percStr); + } + catch (err) { + // err + } + } + } + // eslint-disable-next-line no-restricted-globals + if (isNaN(percentage)) { + return 0.00; + } + return percentage; +}; +exports.editreadyParser = editreadyParser; diff --git a/FlowPlugins/FlowHelpers/1.0.0/cliUtils.js b/FlowPlugins/FlowHelpers/1.0.0/cliUtils.js new file mode 100644 index 0000000..392e868 --- /dev/null +++ b/FlowPlugins/FlowHelpers/1.0.0/cliUtils.js @@ -0,0 +1,284 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CLI = exports.getFFmpegVar = void 0; +var cliParsers_1 = require("./cliParsers"); +var fs = require('fs'); +var fancyTimeFormat = function (time) { + // Hours, minutes and seconds + // eslint-disable-next-line no-bitwise + var hrs = ~~(time / 3600); + // eslint-disable-next-line no-bitwise + var mins = ~~((time % 3600) / 60); + // eslint-disable-next-line no-bitwise + var secs = ~~time % 60; + // Output like "1:01" or "4:03:59" or "123:03:59" + var ret = ''; + // if (hrs > 0) { + ret += "".concat(hrs, ":").concat(mins < 10 ? '0' : ''); + // } + ret += "".concat(mins, ":").concat(secs < 10 ? '0' : ''); + ret += "".concat(secs); + return ret; +}; +// frame= 889 fps=106 q=26.0 Lsize= 25526kB time=00:00:35.69 bitrate=5858.3kbits/s speed=4.25x +var getFFmpegVar = function (_a) { + var str = _a.str, variable = _a.variable; + if (typeof str !== 'string') { + return ''; + } + var idx = str.indexOf(variable); + var out = ''; + var initSpacesEnded = false; + if (idx >= 0) { + var startIdx = idx + variable.length + 1; + for (var i = startIdx; i < str.length; i += 1) { + if (initSpacesEnded === true && str[i] === ' ') { + break; + } + else if (initSpacesEnded === false && str[i] !== ' ') { + initSpacesEnded = true; + } + if (initSpacesEnded === true && str[i] !== ' ') { + out += str[i]; + } + } + } + return out; +}; +exports.getFFmpegVar = getFFmpegVar; +var CLI = /** @class */ (function () { + function CLI(config) { + var _this = this; + // @ts-expect-error init + this.config = {}; + this.progAVG = []; + this.oldOutSize = 0; + this.oldEstSize = 0; + this.oldProgress = 0; + this.lastProgCheck = 0; + this.updateETA = function (perc) { + if (perc > 0) { + if (_this.lastProgCheck === 0) { + _this.lastProgCheck = new Date().getTime(); + _this.oldProgress = perc; + } + else if (perc !== _this.oldProgress) { + var n = new Date().getTime(); + var secsSinceLastCheck = (n - _this.lastProgCheck) / 1000; + if (secsSinceLastCheck > 1) { + // eta total + var eta = Math.round((100 / (perc - _this.oldProgress)) * secsSinceLastCheck); + // eta remaining + eta *= ((100 - perc) / 100); + _this.progAVG.push(eta); + // let values = [2, 56, 3, 41, 0, 4, 100, 23]; + var sum = _this.progAVG.reduce( + // eslint-disable-next-line + function (previous, current) { return (current += previous); }); + var avg = sum / _this.progAVG.length; + // est size + var estSize = 0; + var outputFileSizeInGbytes = void 0; + try { + if (fs.existsSync(_this.config.outputFilePath)) { + var singleFileSize = fs.statSync(_this.config.outputFilePath); + singleFileSize = singleFileSize.size; + outputFileSizeInGbytes = singleFileSize / (1024 * 1024 * 1024); + if (outputFileSizeInGbytes !== _this.oldOutSize) { + _this.oldOutSize = outputFileSizeInGbytes; + estSize = outputFileSizeInGbytes + + ((100 - perc) / perc) * outputFileSizeInGbytes; + _this.oldEstSize = estSize; + } + } + } + catch (err) { + // eslint-disable-next-line no-console + console.log(err); + } + _this.config.updateWorker({ + ETA: fancyTimeFormat(avg), + outputFileSizeInGbytes: outputFileSizeInGbytes === undefined ? 0 : outputFileSizeInGbytes, + estSize: _this.oldEstSize === undefined ? 0 : _this.oldEstSize, + }); + if (_this.progAVG.length > 30) { + _this.progAVG.splice(0, 1); + } + _this.lastProgCheck = n; + _this.oldProgress = perc; + } + } + } + }; + this.parseOutput = function (data) { + var _a, _b, _c, _d, _e, _f, _g; + var str = "".concat(data); + // + if (_this.config.logFullCliOutput === true) { + _this.config.jobLog(str); + } + if (_this.config.cli.toLowerCase().includes('handbrake')) { + var percentage = (0, cliParsers_1.handbrakeParser)({ + str: str, + }); + if (percentage > 0) { + _this.updateETA(percentage); + _this.config.updateWorker({ + percentage: percentage, + }); + } + } + else if (_this.config.cli.toLowerCase().includes('ffmpeg')) { + var n = str.indexOf('fps'); + var shouldUpdate = str.length >= 6 && n >= 6; + var fps = parseInt((0, exports.getFFmpegVar)({ + str: str, + variable: 'fps', + }), 10); + var frameCount = 0; + try { + // @ts-expect-error type + var frameCountTmp = (_a = _this.config.inputFileObj.ffProbeData) === null || _a === void 0 ? void 0 : _a.streams.filter(function (row) { return row.codec_type === 'video'; })[0].nb_frames; + if (frameCountTmp + // @ts-expect-error type + && !isNaN(frameCountTmp)) { // eslint-disable-line no-restricted-globals + // @ts-expect-error type + frameCount = frameCountTmp; + } + } + catch (err) { + // err + } + var percentage = (0, cliParsers_1.ffmpegParser)({ + str: str, + frameCount: frameCount, + videoFrameRate: (_c = (_b = _this.config.inputFileObj) === null || _b === void 0 ? void 0 : _b.meta) === null || _c === void 0 ? void 0 : _c.VideoFrameRate, + ffprobeDuration: (_e = (_d = _this.config.inputFileObj.ffProbeData) === null || _d === void 0 ? void 0 : _d.format) === null || _e === void 0 ? void 0 : _e.duration, + metaDuration: (_g = (_f = _this.config.inputFileObj) === null || _f === void 0 ? void 0 : _f.meta) === null || _g === void 0 ? void 0 : _g.Duration, + }); + if (shouldUpdate === true && fps > 0) { + _this.config.updateWorker({ + fps: fps, + }); + } + if (shouldUpdate === true && percentage > 0) { + _this.updateETA(percentage); + _this.config.updateWorker({ + percentage: percentage, + }); + } + } + else if (_this.config.cli.toLowerCase().includes('editready')) { + var percentage = (0, cliParsers_1.editreadyParser)({ + str: str, + }); + if (percentage > 0) { + _this.updateETA(percentage); + _this.config.updateWorker({ + percentage: percentage, + }); + } + } + }; + this.runCli = function () { return __awaiter(_this, void 0, void 0, function () { + var childProcess, errorLogFull, cliExitCode; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + childProcess = require('child_process'); + errorLogFull = []; + // eslint-disable-next-line no-console + this.config.jobLog("Running ".concat(this.config.cli, " ").concat(this.config.spawnArgs.join(' '))); + return [4 /*yield*/, new Promise(function (resolve) { + try { + var opts = _this.config.spawnOpts || {}; + var thread = childProcess.spawn(_this.config.cli, _this.config.spawnArgs, opts); + thread.stdout.on('data', function (data) { + // eslint-disable-next-line no-console + // console.log(data.toString()); + errorLogFull.push(data.toString()); + _this.parseOutput(data); + }); + thread.stderr.on('data', function (data) { + // eslint-disable-next-line no-console + // console.log(data.toString()); + errorLogFull.push(data.toString()); + _this.parseOutput(data); + }); + thread.on('error', function () { + // catches execution error (bad file) + // eslint-disable-next-line no-console + console.log(1, "Error executing binary: ".concat(_this.config.cli)); + resolve(1); + }); + // thread.stdout.pipe(process.stdout); + // thread.stderr.pipe(process.stderr); + thread.on('close', function (code) { + if (code !== 0) { + // eslint-disable-next-line no-console + console.log(code, 'CLI error'); + } + resolve(code); + }); + } + catch (err) { + // catches execution error (no file) + // eslint-disable-next-line no-console + console.log(1, "Error executing binary: ".concat(_this.config.cli)); + resolve(1); + } + })]; + case 1: + cliExitCode = _a.sent(); + if (!this.config.logFullCliOutput) { + this.config.jobLog(errorLogFull.slice(-1000).join('')); + } + return [2 /*return*/, { + cliExitCode: cliExitCode, + errorLogFull: errorLogFull, + }]; + } + }); + }); }; + this.config = config; + } + return CLI; +}()); +exports.CLI = CLI; diff --git a/FlowPlugins/FlowHelpers/1.0.0/fileUtils.js b/FlowPlugins/FlowHelpers/1.0.0/fileUtils.js new file mode 100644 index 0000000..d756ba8 --- /dev/null +++ b/FlowPlugins/FlowHelpers/1.0.0/fileUtils.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFfType = exports.getFileName = exports.getContainer = void 0; +var getContainer = function (filePath) { + var parts = filePath.split('.'); + return parts[parts.length - 1]; +}; +exports.getContainer = getContainer; +var getFileName = function (filePath) { + var parts = filePath.split('/'); + var fileNameAndContainer = parts[parts.length - 1]; + var parts2 = fileNameAndContainer.split('.'); + return parts2[0]; +}; +exports.getFileName = getFileName; +var getFfType = function (codecType) { return (codecType === 'video' ? 'v' : 'a'); }; +exports.getFfType = getFfType; diff --git a/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.js b/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.js new file mode 100644 index 0000000..44fad7b --- /dev/null +++ b/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.js @@ -0,0 +1,325 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getEncoder = exports.getBestNvencDevice = exports.hasEncoder = void 0; +var hasEncoder = function (_a) { + var ffmpegPath = _a.ffmpegPath, encoder = _a.encoder, inputArgs = _a.inputArgs, filter = _a.filter; + return __awaiter(void 0, void 0, void 0, function () { + var exec, isEnabled, err_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + exec = require('child_process').exec; + isEnabled = false; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, new Promise(function (resolve) { + var command = "".concat(ffmpegPath, " ").concat(inputArgs.join(' ') || '', " -f lavfi -i color=c=black:s=256x256:d=1:r=30") + + " ".concat(filter || '') + + " -c:v ".concat(encoder, " -f null /dev/null"); + exec(command, function ( + // eslint-disable-next-line + error) { + if (error) { + resolve(false); + return; + } + resolve(true); + }); + })]; + case 2: + isEnabled = _b.sent(); + return [3 /*break*/, 4]; + case 3: + err_1 = _b.sent(); + // eslint-disable-next-line no-console + console.log(err_1); + return [3 /*break*/, 4]; + case 4: return [2 /*return*/, isEnabled]; + } + }); + }); +}; +exports.hasEncoder = hasEncoder; +// credit to UNCode101 for this +var getBestNvencDevice = function (_a) { + var args = _a.args, nvencDevice = _a.nvencDevice; + var execSync = require('child_process').execSync; + var gpu_num = -1; + var lowest_gpu_util = 100000; + var result_util = 0; + var gpu_count = -1; + var gpu_names = ''; + var gpus_to_exclude = []; + // inputs.exclude_gpus === '' ? [] : inputs.exclude_gpus.split(',').map(Number); + try { + gpu_names = execSync('nvidia-smi --query-gpu=name --format=csv,noheader'); + gpu_names = gpu_names.toString().trim(); + var gpu_namesArr = gpu_names.split(/\r?\n/); + /* When nvidia-smi returns an error it contains 'nvidia-smi' in the error + Example: Linux: nvidia-smi: command not found + Windows: 'nvidia-smi' is not recognized as an internal or external command, + operable program or batch file. */ + if (!gpu_namesArr[0].includes('nvidia-smi')) { + gpu_count = gpu_namesArr.length; + } + } + catch (error) { + args.jobLog('Error in reading nvidia-smi output! \n'); + } + if (gpu_count > 0) { + for (var gpui = 0; gpui < gpu_count; gpui += 1) { + // Check if GPU # is in GPUs to exclude + if (gpus_to_exclude.includes(String(gpui))) { + args.jobLog("GPU ".concat(gpui, ": ").concat(gpu_names[gpui], " is in exclusion list, will not be used!\n")); + } + else { + try { + var cmd_gpu = "nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits -i ".concat(gpui); + result_util = parseInt(execSync(cmd_gpu), 10); + if (!Number.isNaN(result_util)) { // != "No devices were found") { + args.jobLog("GPU ".concat(gpui, " : Utilization ").concat(result_util, "%\n")); + if (result_util < lowest_gpu_util) { + gpu_num = gpui; + lowest_gpu_util = result_util; + } + } + } + catch (error) { + args.jobLog("Error in reading GPU ".concat(gpui, " Utilization\nError: ").concat(error, "\n")); + } + } + } + } + if (gpu_num >= 0) { + // eslint-disable-next-line no-param-reassign + nvencDevice.inputArgs.push('-hwaccel_device', "".concat(gpu_num)); + // eslint-disable-next-line no-param-reassign + nvencDevice.outputArgs.push('-gpu', "".concat(gpu_num)); + } + return nvencDevice; +}; +exports.getBestNvencDevice = getBestNvencDevice; +var encoderFilter = function (encoder, targetCodec) { + if (targetCodec === 'hevc' && (encoder.includes('hevc') || encoder.includes('h265'))) { + return true; + } + if (targetCodec === 'h264' && encoder.includes('h264')) { + return true; + } + return false; +}; +var getEncoder = function (_a) { + var targetCodec = _a.targetCodec, hardwareEncoding = _a.hardwareEncoding, args = _a.args; + return __awaiter(void 0, void 0, void 0, function () { + var gpuEncoders, filteredGpuEncoders, _i, filteredGpuEncoders_1, gpuEncoder, _b, enabledDevices, res; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + if (!(args.workerType + && args.workerType.includes('gpu') + && hardwareEncoding && (targetCodec === 'hevc' || targetCodec === 'h264'))) return [3 /*break*/, 5]; + gpuEncoders = [ + { + encoder: 'hevc_nvenc', + enabled: false, + inputArgs: [ + '-hwaccel', + 'cuda', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'hevc_amf', + enabled: false, + inputArgs: [], + outputArgs: [], + filter: '', + }, + { + encoder: 'hevc_vaapi', + inputArgs: [ + '-hwaccel', + 'vaapi', + '-hwaccel_device', + '/dev/dri/renderD128', + '-hwaccel_output_format', + 'vaapi', + ], + outputArgs: [], + enabled: false, + filter: '-vf format=nv12,hwupload', + }, + { + encoder: 'hevc_qsv', + enabled: false, + inputArgs: [ + '-hwaccel', + 'qsv', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'hevc_videotoolbox', + enabled: false, + inputArgs: [ + '-hwaccel', + 'videotoolbox', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'h264_nvenc', + enabled: false, + inputArgs: [ + '-hwaccel', + 'cuda', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'h264_amf', + enabled: false, + inputArgs: [], + outputArgs: [], + filter: '', + }, + { + encoder: 'h264_qsv', + enabled: false, + inputArgs: [ + '-hwaccel', + 'qsv', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'h264_videotoolbox', + enabled: false, + inputArgs: [ + '-hwaccel', + 'videotoolbox', + ], + outputArgs: [], + filter: '', + }, + ]; + filteredGpuEncoders = gpuEncoders.filter(function (device) { return encoderFilter(device.encoder, targetCodec); }); + _i = 0, filteredGpuEncoders_1 = filteredGpuEncoders; + _c.label = 1; + case 1: + if (!(_i < filteredGpuEncoders_1.length)) return [3 /*break*/, 4]; + gpuEncoder = filteredGpuEncoders_1[_i]; + // eslint-disable-next-line no-await-in-loop + _b = gpuEncoder; + return [4 /*yield*/, (0, exports.hasEncoder)({ + ffmpegPath: args.ffmpegPath, + encoder: gpuEncoder.encoder, + inputArgs: gpuEncoder.inputArgs, + filter: gpuEncoder.filter, + })]; + case 2: + // eslint-disable-next-line no-await-in-loop + _b.enabled = _c.sent(); + _c.label = 3; + case 3: + _i++; + return [3 /*break*/, 1]; + case 4: + enabledDevices = gpuEncoders.filter(function (device) { return device.enabled === true; }); + if (enabledDevices.length > 0) { + if (enabledDevices[0].encoder.includes('nvenc')) { + res = (0, exports.getBestNvencDevice)({ + args: args, + nvencDevice: enabledDevices[0], + }); + return [2 /*return*/, __assign(__assign({}, res), { isGpu: true })]; + } + return [2 /*return*/, { + encoder: enabledDevices[0].encoder, + inputArgs: enabledDevices[0].inputArgs, + outputArgs: enabledDevices[0].outputArgs, + isGpu: true, + }]; + } + _c.label = 5; + case 5: + if (targetCodec === 'hevc') { + return [2 /*return*/, { + encoder: 'libx265', + inputArgs: [], + outputArgs: [], + isGpu: false, + }]; + } + if (targetCodec === 'h264') { + return [2 /*return*/, { + encoder: 'libx264', + inputArgs: [], + outputArgs: [], + isGpu: false, + }]; + } + return [2 /*return*/, { + encoder: targetCodec, + inputArgs: [], + outputArgs: [], + isGpu: false, + }]; + } + }); + }); +}; +exports.getEncoder = getEncoder; diff --git a/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.test.js b/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.test.js new file mode 100644 index 0000000..d3c0a49 --- /dev/null +++ b/FlowPlugins/FlowHelpers/1.0.0/hardwareUtils.test.js @@ -0,0 +1,67 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var hardwareUtils_1 = require("./hardwareUtils"); +var run = function () { return __awaiter(void 0, void 0, void 0, function () { + var encoderProperties; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, (0, hardwareUtils_1.getEncoder)({ + targetCodec: 'h264', + hardwareEncoding: true, + // @ts-expect-error type + args: { + workerType: 'transcodegpu', + ffmpegPath: 'ffmpeg', + jobLog: function (t) { + // eslint-disable-next-line no-console + console.log(t); + }, + }, + })]; + case 1: + encoderProperties = _a.sent(); + // eslint-disable-next-line no-console + console.log({ + encoderProperties: encoderProperties, + }); + return [2 /*return*/]; + } + }); +}); }; +void run(); diff --git a/FlowPlugins/FlowHelpers/1.0.0/interfaces/interfaces.js b/FlowPlugins/FlowHelpers/1.0.0/interfaces/interfaces.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/FlowPlugins/FlowHelpers/1.0.0/interfaces/interfaces.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/FlowPlugins/FlowHelpers/1.0.0/interfaces/synced/IFileObject.js b/FlowPlugins/FlowHelpers/1.0.0/interfaces/synced/IFileObject.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/FlowPlugins/FlowHelpers/1.0.0/interfaces/synced/IFileObject.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/FlowPlugins/FlowHelpers/1.0.0/interfaces/synced/jobInterface.js b/FlowPlugins/FlowHelpers/1.0.0/interfaces/synced/jobInterface.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/FlowPlugins/FlowHelpers/1.0.0/interfaces/synced/jobInterface.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/FlowPluginsTs/CommunityFlowPlugins/classic/runClassicFilterPlugin/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/classic/runClassicFilterPlugin/1.0.0/index.ts new file mode 100644 index 0000000..b7f7e2f --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/classic/runClassicFilterPlugin/1.0.0/index.ts @@ -0,0 +1,115 @@ +import { getContainer } from '../../../../FlowHelpers/1.0.0/fileUtils'; +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Run Classic Filter Plugin', + description: 'Run one of Tdarr\'s classic plugins that has Operation: Filter', + style: { + borderColor: 'orange', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'pluginSourceId', + type: 'string', + defaultValue: 'Community:Tdarr_Plugin_00td_filter_by_codec', + inputUI: { + type: 'dropdown', + options: [], + }, + tooltip: 'Specify the classic plugin ID', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File met conditions, would traditionally continue to next plugin in plugin stack', + }, + { + number: 2, + tooltip: 'File did not meet conditions, would traditionally break out of plugin stack', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args: IpluginInputArgs): Promise => { + const path = require('path'); + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const pluginSourceId = String(args.inputs.pluginSourceId); + const parts = pluginSourceId.split(':'); + const pluginSource = parts[0]; + const pluginId = parts[1]; + + const relativePluginPath = `../../../../../${pluginSource}/${pluginId}.js`; + const absolutePath = path.resolve(__dirname, relativePluginPath); + + let classicPlugin; + if (pluginSource === 'Community') { + classicPlugin = args.deps.importFresh(relativePluginPath); + } else { + // eslint-disable-next-line no-await-in-loop + const res = await args.deps.axiosMiddleware('api/v2/read-plugin', { + plugin: { + id: pluginId, + source: pluginSource, + }, + }); + + classicPlugin = args.deps.requireFromString(res.pluginRaw, absolutePath); + } + + if (classicPlugin.details().Operation !== 'Filter') { + throw new Error( + `${'This plugin is meant for classic plugins that have ' + + 'Operation: Filter. This classic plugin has Operation: '}${classicPlugin.details().Operation}` + + 'Please use the Run Classic Transcode Flow Plugin plugin instead.' + , + ); + } + + const container = getContainer(args.inputFileObj._id); + const cacheFilePath = `${args.workDir}/tempFile_${new Date().getTime()}.${container}`; + + const otherArguments = { + handbrakePath: args.handbrakePath, + ffmpegPath: args.ffmpegPath, + mkvpropeditPath: args.mkvpropeditPath, + originalLibraryFile: args.originalLibraryFile, + nodeHardwareType: args.nodeHardwareType, + pluginCycle: 0, + workerType: args.workerType, + version: args.config.version, + platform_arch_isdocker: args.platform_arch_isdocker, + cacheFilePath, + job: args.job, + }; + + const result = await classicPlugin.plugin(args.inputFileObj, args.librarySettings, args.inputs, otherArguments); + + args.jobLog(JSON.stringify(result, null, 2)); + + const outputNumber = result.processFile ? 1 : 2; + + return { + outputFileObj: args.inputFileObj, + outputNumber, + variables: args.variables, + }; +}; + +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/classic/runClassicTranscodePlugin/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/classic/runClassicTranscodePlugin/1.0.0/index.ts new file mode 100644 index 0000000..c70489a --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/classic/runClassicTranscodePlugin/1.0.0/index.ts @@ -0,0 +1,237 @@ +import { CLI } from '../../../../FlowHelpers/1.0.0/cliUtils'; +import { getContainer } from '../../../../FlowHelpers/1.0.0/fileUtils'; +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Run Classic Transcode Plugin', + description: 'Run one of Tdarr\'s classic plugins that has Operation: Transcode', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'pluginSourceId', + type: 'string', + defaultValue: 'Community:Tdarr_Plugin_MC93_Migz1FFMPEG', + inputUI: { + type: 'dropdown', + options: [], + }, + tooltip: 'Specify the classic plugin ID', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +const replaceContainer = (filePath:string, container:string): string => { + const parts = filePath.split('.'); + parts[parts.length - 1] = container.split('.').join(''); + return parts.join('.'); +}; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args: IpluginInputArgs): Promise => { + const path = require('path'); + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const pluginSourceId = String(args.inputs.pluginSourceId); + const parts = pluginSourceId.split(':'); + const pluginSource = parts[0]; + const pluginId = parts[1]; + + const relativePluginPath = `../../../../../${pluginSource}/${pluginId}.js`; + const absolutePath = path.resolve(__dirname, relativePluginPath); + + let classicPlugin; + if (pluginSource === 'Community') { + classicPlugin = args.deps.importFresh(relativePluginPath); + } else { + // eslint-disable-next-line no-await-in-loop + const res = await args.deps.axiosMiddleware('api/v2/read-plugin', { + plugin: { + id: pluginId, + source: pluginSource, + }, + }); + + classicPlugin = args.deps.requireFromString(res.pluginRaw, absolutePath); + } + + if (classicPlugin.details().Operation === 'Filter') { + throw new Error( + `${'This plugin is meant for classic plugins that have ' + + 'Operation: Transcode. This classic plugin has Operation: '}${classicPlugin.details().Operation}` + + 'Please use the Run Classic Filter Flow Plugin plugin instead.' + , + ); + } + + const container = getContainer(args.inputFileObj._id); + let cacheFilePath = `${args.workDir}/tempFile_${new Date().getTime()}.${container}`; + + const otherArguments = { + handbrakePath: args.handbrakePath, + ffmpegPath: args.ffmpegPath, + mkvpropeditPath: args.mkvpropeditPath, + originalLibraryFile: args.originalLibraryFile, + nodeHardwareType: args.nodeHardwareType, + pluginCycle: 0, + workerType: args.workerType, + version: args.config.version, + platform_arch_isdocker: args.platform_arch_isdocker, + cacheFilePath, + job: args.job, + }; + + const result = await classicPlugin.plugin(args.inputFileObj, args.librarySettings, args.inputs, otherArguments); + + args.jobLog(JSON.stringify(result, null, 2)); + + // --- Backwards compatibility------------ + if (result.handBrakeMode) { + result.handbrakeMode = result.handBrakeMode; + } + + if (result.FFmpegMode) { + result.ffmpegMode = result.FFmpegMode; + } + //---------------------------------------- + + if (result.ffmpegMode) { + result.cliToUse = 'ffmpeg'; + } else if (result.handbrakeMode) { + result.cliToUse = 'handbrake'; + } else if (typeof result?.custom?.cliPath === 'string') { + const { cliPath } = result.custom; + if (cliPath.toLowerCase().includes('ffmpeg')) { + result.cliToUse = 'ffmpeg'; + } else if (cliPath.toLowerCase().includes('handbrake')) { + result.cliToUse = 'handbrake'; + } else if (cliPath.toLowerCase().includes('editready')) { + result.cliToUse = 'editready'; + } else if (cliPath.toLowerCase().includes('av1an')) { + result.cliToUse = 'av1an'; + } + } + + result.workerLog = result.transcodeSettingsLog; + args.jobLog(JSON.stringify(result, null, 2)); + + if (result.error) { + throw new Error(`Plugin ${absolutePath} failed: ${result.error}`); + } if (result.processFile !== true) { + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; + } + + const customArgs = result?.custom?.args; + const isCustomConfig = (Array.isArray(customArgs) && customArgs.length > 0) + || (typeof customArgs === 'string' && customArgs.length > 0); + + if (!isCustomConfig) { + cacheFilePath = replaceContainer(cacheFilePath, result.container); + } else { + cacheFilePath = result.custom.outputPath; + } + + let presetSplit; + if (result.preset.includes('')) { + presetSplit = result.preset.split(''); + } else { + presetSplit = result.preset.split(','); + } + + let workerCommand: string[] = []; + let cliPath = ''; + + if (isCustomConfig) { + cliPath = result?.custom?.cliPath; + + if (Array.isArray(customArgs)) { + workerCommand = customArgs; + } else { + workerCommand = [ + ...args.deps.parseArgsStringToArgv(customArgs, '', ''), + ]; + } + } else { + // working on windows with '` and spaces + // working on unix with ' + switch (true) { + case result.cliToUse === 'handbrake': + workerCommand = [ + '-i', + `${args.inputFileObj._id}`, + '-o', + `${cacheFilePath}`, + ...args.deps.parseArgsStringToArgv(result.preset, '', ''), + ]; + + cliPath = `${args.handbrakePath}`; + break; + + case result.cliToUse === 'ffmpeg': + workerCommand = [ + ...args.deps.parseArgsStringToArgv(presetSplit[0], '', ''), + '-i', + `${args.inputFileObj._id}`, + ...args.deps.parseArgsStringToArgv(presetSplit[1], '', ''), + `${cacheFilePath}`, + ]; + cliPath = `${args.ffmpegPath}`; + break; + default: + } + } + + const cli = new CLI({ + cli: cliPath, + spawnArgs: workerCommand, + spawnOpts: {}, + jobLog: args.jobLog, + outputFilePath: cacheFilePath, + inputFileObj: args.inputFileObj, + logFullCliOutput: args.logFullCliOutput, + updateWorker: args.updateWorker, + }); + + const res = await cli.runCli(); + + if (res.cliExitCode !== 0) { + args.jobLog(`Running ${cliPath} failed`); + throw new Error(`Running ${cliPath} failed`); + } + + args.logOutcome('tSuc'); + + return { + outputFileObj: { + _id: cacheFilePath, + }, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommand10BitVideo/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommand10BitVideo/1.0.0/index.ts new file mode 100644 index 0000000..ba54fd3 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommand10BitVideo/1.0.0/index.ts @@ -0,0 +1,49 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = () :IpluginDetails => ({ + name: '10 Bit Video', + description: 'Set 10 Bit Video', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { + const stream = args.variables.ffmpegCommand.streams[i]; + if (stream.codec_type === 'video') { + stream.outputArgs.push('-pix_fmt:v:{outputTypeIndex}', 'p010le', '-profile:v:{outputTypeIndex}', 'main10'); + } + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCropBlackBars/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCropBlackBars/1.0.0/index.ts new file mode 100644 index 0000000..c28801c --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCropBlackBars/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = () :IpluginDetails => ({ + name: 'Crop Black Bars', + description: 'Crop Black Bars', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.ts new file mode 100644 index 0000000..52392a0 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandCustomArguments/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = () :IpluginDetails => ({ + name: 'Custom Arguments', + description: 'Custom Arguments', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandEnsureAudioStream/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandEnsureAudioStream/1.0.0/index.ts new file mode 100644 index 0000000..d7d9365 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandEnsureAudioStream/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = () :IpluginDetails => ({ + name: 'Ensure Audio Stream', + description: 'Ensure that the file has an audio stream with set codec and channel count', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts new file mode 100644 index 0000000..0e3c32a --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.ts @@ -0,0 +1,174 @@ +import { + IffmpegCommandStream, + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; +import { CLI } from '../../../../FlowHelpers/1.0.0/cliUtils'; +import { getContainer } from '../../../../FlowHelpers/1.0.0/fileUtils'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Execute', + description: 'Execute the created FFmpeg command', + style: { + borderColor: 'green', + }, + tags: 'video', + + isStartPlugin: false, + sidebarPosition: 2, + icon: 'faPlay', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +const getOuputStreamIndex = (streams: IffmpegCommandStream[], stream: IffmpegCommandStream): number => { + let index = -1; + + for (let idx = 0; idx < streams.length; idx += 1) { + if (!stream.removed) { + index += 1; + } + + if (streams[idx].index === stream.index) { + break; + } + } + + return index; +}; + +const getOuputStreamTypeIndex = (streams: IffmpegCommandStream[], stream: IffmpegCommandStream): number => { + let index = -1; + + for (let idx = 0; idx < streams.length; idx += 1) { + if (!stream.removed && streams[idx].codec_type === stream.codec_type) { + index += 1; + } + + if (streams[idx].index === stream.index) { + break; + } + } + + return index; +}; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args: IpluginInputArgs): Promise => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const cliArgs: string[] = []; + + cliArgs.push('-y'); + cliArgs.push('-i'); + cliArgs.push(args.inputFileObj._id); + + const inputArgs: string[] = []; + let { shouldProcess, streams } = args.variables.ffmpegCommand; + + streams = streams.filter((stream) => { + if (stream.removed) { + shouldProcess = true; + } + return !stream.removed; + }); + + if (getContainer(args.inputFileObj._id) !== args.variables.ffmpegCommand.container) { + shouldProcess = true; + } + + for (let i = 0; i < streams.length; i += 1) { + const stream = streams[i]; + + stream.outputArgs = stream.outputArgs.map((arg) => { + if (arg.includes('{outputIndex}')) { + // eslint-disable-next-line no-param-reassign + arg = arg.replace('{outputIndex}', String(getOuputStreamIndex(streams, stream))); + } + + if (arg.includes('{outputTypeIndex}')) { + // eslint-disable-next-line no-param-reassign + arg = arg.replace('{outputTypeIndex}', String(getOuputStreamTypeIndex(streams, stream))); + } + + return arg; + }); + + cliArgs.push(...stream.mapArgs); + + if (stream.outputArgs.length === 0) { + cliArgs.push(`-c:${getOuputStreamIndex(streams, stream)}`, 'copy'); + } else { + cliArgs.push(...stream.outputArgs); + } + + inputArgs.push(...stream.inputArgs); + } + + if (!shouldProcess) { + args.jobLog('No need to process file, already as required'); + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; + } + + const idx = cliArgs.indexOf('-i'); + cliArgs.splice(idx, 0, ...inputArgs); + + const outputFilePath = `${args.workDir}/tempFile_${new Date().getTime()}.${args.variables.ffmpegCommand.container}`; + cliArgs.push(outputFilePath); + + args.jobLog('Processing file'); + args.jobLog(JSON.stringify({ + cliArgs, + outputFilePath, + })); + + args.updateWorker({ + CLIType: args.ffmpegPath, + preset: cliArgs.join(' '), + }); + + const cli = new CLI({ + cli: args.ffmpegPath, + spawnArgs: cliArgs, + spawnOpts: {}, + jobLog: args.jobLog, + outputFilePath, + inputFileObj: args.inputFileObj, + logFullCliOutput: args.logFullCliOutput, + updateWorker: args.updateWorker, + }); + + const res = await cli.runCli(); + + if (res.cliExitCode !== 0) { + args.jobLog('Running FFmpeg failed'); + throw new Error('FFmpeg failed'); + } + + args.logOutcome('tSuc'); + + return { + outputFileObj: { + _id: outputFilePath, + }, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.ts new file mode 100644 index 0000000..4fa3be5 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandHdrToSdr/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = () :IpluginDetails => ({ + name: 'HDR to SDR', + description: 'Convert HDR to SDR', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandNormalizeAudio/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandNormalizeAudio/1.0.0/index.ts new file mode 100644 index 0000000..2b79ede --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandNormalizeAudio/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = () :IpluginDetails => ({ + name: 'Normalize Audio', + description: 'Normalize Audio', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveDataStreams/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveDataStreams/1.0.0/index.ts new file mode 100644 index 0000000..dbf9aa9 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveDataStreams/1.0.0/index.ts @@ -0,0 +1,51 @@ +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ + +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint-disable no-param-reassign */ +const details = ():IpluginDetails => ({ + name: 'Remove Data Streams', + description: 'Remove Data Streams ', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + args.variables.ffmpegCommand.streams.forEach((stream) => { + if (stream.codec_type === 'data') { + stream.removed = true; + } + }); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveSubtitles/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveSubtitles/1.0.0/index.ts new file mode 100644 index 0000000..60ac7a8 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRemoveSubtitles/1.0.0/index.ts @@ -0,0 +1,51 @@ +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ + +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint-disable no-param-reassign */ +const details = ():IpluginDetails => ({ + name: 'Remove Subtitles', + description: 'Remove subtitles from the file', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + args.variables.ffmpegCommand.streams.forEach((stream) => { + if (stream.codec_type === 'subtitle') { + stream.removed = true; + } + }); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; + +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRorderStreams/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRorderStreams/1.0.0/index.ts new file mode 100644 index 0000000..153ae14 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandRorderStreams/1.0.0/index.ts @@ -0,0 +1,228 @@ +import { + IffmpegCommandStream, + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; +import { Istreams } from '../../../../FlowHelpers/1.0.0/interfaces/synced/IFileObject'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Reorder Streams', + description: 'Reorder Streams', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'processOrder', + type: 'string', + defaultValue: 'codecs,channels,languages,streamTypes', + inputUI: { + type: 'text', + }, + tooltip: + `Specify the process order. +For example, if 'languages' is first, the streams will be ordered based on that first. +So put the most important properties last. +The default order is suitable for most people. + + \\nExample:\\n + codecs,channels,languages,streamTypes + `, + }, + { + name: 'languages', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: + `Specify the language tags order, separated by commas. Leave blank to disable. + \\nExample:\\n + eng,fre + `, + }, + { + name: 'channels', + type: 'string', + defaultValue: '7.1,5.1,2,1', + inputUI: { + type: 'text', + }, + tooltip: + `Specify the channels order, separated by commas. Leave blank to disable. + + \\nExample:\\n + 7.1,5.1,2,1`, + }, + { + name: 'codecs', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: + `Specify the codec order, separated by commas. Leave blank to disable. + + \\nExample:\\n + aac,ac3`, + }, + { + name: 'streamTypes', + type: 'string', + defaultValue: 'video,audio,subtitle', + inputUI: { + type: 'text', + }, + tooltip: + `Specify the streamTypes order, separated by commas. Leave blank to disable. + \\nExample:\\n + video,audio,subtitle + `, + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + let streams: IffmpegCommandStream[] = JSON.parse(JSON.stringify(args.variables.ffmpegCommand.streams)); + + const originalStreams = JSON.stringify(streams); + + streams.forEach((stream, index) => { + // eslint-disable-next-line no-param-reassign + stream.typeIndex = index; + }); + + const sortStreams = (sortType: { + inputs: string, + getValue: (stream: Istreams) => string, + }) => { + const items = sortType.inputs.split(','); + items.reverse(); + for (let i = 0; i < items.length; i += 1) { + const matchedStreams = []; + for (let j = 0; j < streams.length; j += 1) { + if (String(sortType.getValue(streams[j])) === String(items[i])) { + if ( + streams[j].codec_long_name + && ( + streams[j].codec_long_name.includes('image') + || streams[j].codec_name.includes('png') + ) + ) { + // do nothing, ffmpeg bug, doesn't move image streams + } else { + matchedStreams.push(streams[j]); + streams.splice(j, 1); + j -= 1; + } + } + } + streams = matchedStreams.concat(streams); + } + }; + + const processOrder = String(args.inputs.processOrder); + + const { + languages, codecs, channels, streamTypes, + } = args.inputs; + + const sortTypes:{ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any, + } = { + languages: { + getValue: (stream: Istreams) => { + if (stream?.tags?.language) { + return stream.tags.language; + } + + return ''; + }, + inputs: languages, + }, + codecs: { + getValue: (stream: Istreams) => { + try { + return stream.codec_name; + } catch (err) { + // err + } + return ''; + }, + inputs: codecs, + }, + channels: { + getValue: (stream: Istreams) => { + const chanMap:{ + [key: number]: string + } = { + 8: '7.1', + 6: '5.1', + 2: '2', + 1: '1', + }; + + if (stream?.channels && chanMap[stream.channels]) { + return chanMap[stream.channels]; + } + + return ''; + }, + inputs: channels, + }, + streamTypes: { + getValue: (stream:Istreams) => { + if (stream.codec_type) { + return stream.codec_type; + } + return ''; + }, + inputs: streamTypes, + }, + }; + + const processOrderArr = processOrder.split(','); + + for (let k = 0; k < processOrderArr.length; k += 1) { + if (sortTypes[processOrderArr[k]] && sortTypes[processOrderArr[k]].inputs) { + sortStreams(sortTypes[processOrderArr[k]]); + } + } + + if (JSON.stringify(streams) !== originalStreams) { + // eslint-disable-next-line no-param-reassign + args.variables.ffmpegCommand.shouldProcess = true; + // eslint-disable-next-line no-param-reassign + args.variables.ffmpegCommand.streams = streams; + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts new file mode 100644 index 0000000..15662d0 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetContainer/1.0.0/index.ts @@ -0,0 +1,60 @@ +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ + +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint-disable no-param-reassign */ +const details = ():IpluginDetails => ({ + name: 'Set Container', + description: 'Set the container of the output file', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'container', + type: 'string', + defaultValue: 'mkv', + inputUI: { + type: 'dropdown', + options: [ + 'mkv', + 'mp4', + ], + }, + tooltip: 'Specify the container to use', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + args.variables.ffmpegCommand.container = String(args.inputs.container); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVdeoResolution/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVdeoResolution/1.0.0/index.ts new file mode 100644 index 0000000..3190f72 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVdeoResolution/1.0.0/index.ts @@ -0,0 +1,103 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = () :IpluginDetails => ({ + name: 'Set Video Resolution', + description: 'Change video resolution', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'targetResolution', + type: 'string', + defaultValue: '1080p', + inputUI: { + type: 'dropdown', + options: [ + '480p', + '720p', + '1080p', + '1440p', + '4KUHD', + ], + }, + tooltip: 'Specify the codec to use', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +const getVfScale = ( + targetResolution: string, +):string[] => { + switch (targetResolution) { + case '480p': + return ['-vf', 'scale=720:-2']; + + case '576p': + return ['-vf', 'scale=720:-2']; + + case '720p': + return ['-vf', 'scale=1280:-2']; + + case '1080p': + return ['-vf', 'scale=1920:-2']; + + case '1440p': + return ['-vf', 'scale=2560:-2']; + + case '4KUHD': + return ['-vf', 'scale=3840:-2']; + + default: + return ['-vf', 'scale=1920:-2']; + } +}; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { + const stream = args.variables.ffmpegCommand.streams[i]; + + if (stream.codec_type === 'video') { + const targetResolution = String(args.inputs.targetResolution); + + if ( + targetResolution !== args.inputFileObj.video_resolution + ) { + // eslint-disable-next-line no-param-reassign + args.variables.ffmpegCommand.shouldProcess = true; + const scaleArgs = getVfScale(targetResolution); + stream.outputArgs.push(...scaleArgs); + } + } + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoBitrate/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoBitrate/1.0.0/index.ts new file mode 100644 index 0000000..a7c5481 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoBitrate/1.0.0/index.ts @@ -0,0 +1,60 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; +import { getFfType } from '../../../../FlowHelpers/1.0.0/fileUtils'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = () :IpluginDetails => ({ + name: 'Set Video Bitrate', + description: 'Set Video Bitrate', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'bitrate', + type: 'string', + defaultValue: '5000', + inputUI: { + type: 'text', + }, + tooltip: 'Specify bitrate in kbps', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + args.variables.ffmpegCommand.streams.forEach((stream) => { + if (stream.codec_type === 'video') { + const ffType = getFfType(stream.codec_type); + stream.outputArgs.push(`-b:${ffType}:{outputTypeIndex}`, `${String(args.inputs.bitrate)}k`); + } + }); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts new file mode 100644 index 0000000..1bba815 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandSetVideoEncoder/1.0.0/index.ts @@ -0,0 +1,178 @@ +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ + +import { getEncoder } from '../../../../FlowHelpers/1.0.0/hardwareUtils'; +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint-disable no-param-reassign */ +const details = (): IpluginDetails => ({ + name: 'Set Video Encoder', + description: 'Set the video encoder for all streams', + style: { + borderColor: '#6efefc', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'outputCodec', + type: 'string', + defaultValue: 'hevc', + inputUI: { + type: 'dropdown', + options: [ + 'hevc', + // 'vp9', + 'h264', + // 'vp8', + ], + }, + tooltip: 'Specify the codec to use', + }, + { + name: 'ffmpegPreset', + type: 'string', + defaultValue: 'fast', + inputUI: { + type: 'dropdown', + options: [ + 'veryslow', + 'slower', + 'slow', + 'medium', + 'fast', + 'faster', + 'veryfast', + 'superfast', + 'ultrafast', + ], + }, + tooltip: 'Specify the codec to use', + }, + { + name: 'ffmpegQuality', + type: 'number', + defaultValue: '25', + inputUI: { + type: 'text', + }, + tooltip: 'Specify the codec to use', + }, + { + name: 'hardwareEncoding', + type: 'boolean', + defaultValue: 'true', + inputUI: { + type: 'dropdown', + options: [ + 'false', + 'true', + ], + }, + tooltip: 'Specify whether to use hardware encoding if available', + }, + { + name: 'hardwareDecoding', + type: 'boolean', + defaultValue: 'true', + inputUI: { + type: 'dropdown', + options: [ + 'false', + 'true', + ], + }, + tooltip: 'Specify whether to use hardware decoding if available', + }, + { + name: 'forceEncoding', + type: 'boolean', + defaultValue: 'false', + inputUI: { + type: 'dropdown', + options: [ + 'false', + 'true', + ], + }, + tooltip: 'Specify whether to force encoding if stream already has the target codec', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args: IpluginInputArgs): Promise => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const hardwareDecoding = args.inputs.hardwareDecoding === true; + args.variables.ffmpegCommand.hardwareDecoding = hardwareDecoding; + + for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { + const stream = args.variables.ffmpegCommand.streams[i]; + + if (stream.codec_type === 'video') { + const targetCodec = String(args.inputs.outputCodec); + const ffmpegPreset = String(args.inputs.ffmpegPreset); + const ffmpegQuality = String(args.inputs.ffmpegQuality); + const forceEncoding = args.inputs.forceEncoding === true; + const hardwarEncoding = args.inputs.hardwareEncoding === true; + + if ( + forceEncoding + || stream.codec_name !== targetCodec + ) { + args.variables.ffmpegCommand.shouldProcess = true; + + // eslint-disable-next-line no-await-in-loop + const encoderProperties = await getEncoder({ + targetCodec, + hardwareEncoding: hardwarEncoding, + args, + }); + + stream.outputArgs.push('-c:{outputIndex}', encoderProperties.encoder); + + if (encoderProperties.isGpu) { + stream.outputArgs.push('-qp', ffmpegQuality); + } else { + stream.outputArgs.push('-crf', ffmpegQuality); + } + + if (ffmpegPreset) { + stream.outputArgs.push('-preset', ffmpegPreset); + } + + if (hardwareDecoding) { + stream.inputArgs.push(...encoderProperties.inputArgs); + } + + if (encoderProperties.outputArgs) { + stream.outputArgs.push(...encoderProperties.outputArgs); + } + } + } + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandStart/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandStart/1.0.0/index.ts new file mode 100644 index 0000000..83430cf --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandStart/1.0.0/index.ts @@ -0,0 +1,70 @@ +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ + +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; +import { Istreams } from '../../../../FlowHelpers/1.0.0/interfaces/synced/IFileObject'; + +/* eslint-disable no-param-reassign */ +const details = () :IpluginDetails => ({ + name: 'Start', + description: 'Start FFmpeg Command', + style: { + borderColor: 'green', + }, + tags: 'video', + + isStartPlugin: false, + sidebarPosition: 1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const containerParts = args.inputFileObj._id.split('.'); + const container = containerParts[containerParts.length - 1]; + + const ffmpegCommand = { + inputFiles: [], + streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map((stream:Istreams) => ({ + ...stream, + removed: false, + mapArgs: [ + '-map', + `0:${stream.index}`, + ], + inputArgs: [], + outputArgs: [], + })), + container, + hardwareDecoding: false, + shouldProcess: false, + overallInputArguments: [], + overallOuputArguments: [], + }; + + args.variables.ffmpegCommand = ffmpegCommand; + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/checkFileExtension/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/checkFileExtension/1.0.0/index.ts new file mode 100644 index 0000000..4cec839 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/checkFileExtension/1.0.0/index.ts @@ -0,0 +1,68 @@ +import { getContainer } from '../../../../FlowHelpers/1.0.0/fileUtils'; +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Check File Extension', + description: 'Check file extension', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'extensions', + type: 'string', + defaultValue: 'mkv,mp4', + inputUI: { + type: 'text', + }, + tooltip: 'A comma separated list of extensions to check', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File is one of extensions', + }, + { + number: 2, + tooltip: 'File is not one of extensions', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const extensions = String(args.inputs.extensions); + const extensionArray = extensions.trim().split(','); + + const extension = getContainer(args.inputFileObj._id); + + let extensionMatch = false; + + if (extensionArray.includes(extension)) { + extensionMatch = true; + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: extensionMatch ? 1 : 2, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/checkFileMedium/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/checkFileMedium/1.0.0/index.ts new file mode 100644 index 0000000..c3ac47e --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/checkFileMedium/1.0.0/index.ts @@ -0,0 +1,67 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Check File Medium', + description: 'Check if file is video, audio or other type of file', + style: { + borderColor: 'orange', + }, + tags: '', + + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'File medium is a Video', + + }, + { + number: 2, + tooltip: 'File medium is an Audio', + }, + { + number: 3, + tooltip: 'File medium is Other', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + let outputNumber = 1; + switch (args.inputFileObj.fileMedium) { + case 'video': + outputNumber = 1; + break; + case 'audio': + outputNumber = 2; + break; + case 'other': + outputNumber = 3; + break; + default: + throw new Error('File has no fileMedium!'); + } + + return { + outputFileObj: args.inputFileObj, + outputNumber, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/checkFileSize/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/checkFileSize/1.0.0/index.ts new file mode 100644 index 0000000..04043c5 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/checkFileSize/1.0.0/index.ts @@ -0,0 +1,100 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Check File Size', + description: 'Check size of working file', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'unit', + type: 'string', + defaultValue: 'GB', + inputUI: { + type: 'dropdown', + options: [ + 'B', + 'KB', + 'MB', + 'GB', + ], + }, + tooltip: 'Specify the unit to use', + }, + { + name: 'greaterThan', + type: 'number', + defaultValue: '0', + inputUI: { + type: 'text', + }, + tooltip: 'Specify lower bound', + }, + { + name: 'lessThan', + type: 'number', + defaultValue: '10000', + inputUI: { + type: 'text', + }, + tooltip: 'Specify upper bound', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File within range', + }, + { + number: 2, + tooltip: 'File not within range', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + let isWithinRange = false; + let greaterThanBytes = Number(args.inputs.greaterThan); + let lessThanBytes = Number(args.inputs.lessThan); + const fileSizeBytes = args.inputFileObj.file_size * 1000 * 1000; + + if (args.inputs.unit === 'KB') { + greaterThanBytes *= 1000; + lessThanBytes *= 1000; + } else if (args.inputs.unit === 'MB') { + greaterThanBytes *= 1000000; + lessThanBytes *= 1000000; + } else if (args.inputs.unit === 'GB') { + greaterThanBytes *= 1000000000; + lessThanBytes *= 1000000000; + } + + if (fileSizeBytes >= greaterThanBytes && fileSizeBytes <= lessThanBytes) { + isWithinRange = true; + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: isWithinRange ? 1 : 2, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/compareFileSize/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/compareFileSize/1.0.0/index.ts new file mode 100644 index 0000000..b9ab91b --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/compareFileSize/1.0.0/index.ts @@ -0,0 +1,62 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Compare File Size', + description: 'Compare file size of working file compared to original file', + style: { + borderColor: 'orange', + }, + tags: '', + + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Working file is smaller than original file', + }, + { + number: 2, + tooltip: 'Working file is same size as original file', + }, + + { + number: 3, + tooltip: 'Working file is larger than original file', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + let outputNumber = 1; + + if (args.inputFileObj.file_size < args.originalLibraryFile.file_size) { + outputNumber = 1; + } else if (args.inputFileObj.file_size === args.originalLibraryFile.file_size) { + outputNumber = 2; + } else if (args.inputFileObj.file_size > args.originalLibraryFile.file_size) { + outputNumber = 3; + } + + return { + outputFileObj: args.inputFileObj, + outputNumber, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/copyToDirectory/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/copyToDirectory/1.0.0/index.ts new file mode 100644 index 0000000..12f9f9e --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/copyToDirectory/1.0.0/index.ts @@ -0,0 +1,83 @@ +import { promises as fs } from 'fs'; +import { getContainer, getFileName } from '../../../../FlowHelpers/1.0.0/fileUtils'; +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Copy to Directory', + description: 'Copy the working file to a directory', + style: { + borderColor: 'green', + }, + tags: '', + + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [ + { + name: 'outputDirectory', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Specify ouput directory', + }, + { + name: 'makeWorkingFile', + type: 'boolean', + defaultValue: 'false', + inputUI: { + type: 'text', + options: [ + 'false', + 'true', + ], + }, + tooltip: 'Make the copied file the working file', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args: IpluginInputArgs): Promise => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const originalFileName = getFileName(args.originalLibraryFile._id); + const newContainer = getContainer(args.inputFileObj._id); + + const outputPath = `${args.inputs.outputDirectory}/${originalFileName}.${newContainer}`; + + await fs.copyFile(args.inputFileObj._id, outputPath); + + let workingFile = args.inputFileObj._id; + + if (args.inputs.makeWorkingFile) { + workingFile = outputPath; + } + + return { + outputFileObj: { + _id: workingFile, + }, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/moveToDirectory/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/moveToDirectory/1.0.0/index.ts new file mode 100644 index 0000000..c3348cd --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/moveToDirectory/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Move To Directory', + description: 'Move working file to directory.', + style: { + borderColor: 'green', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/moveToDirectory/2.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/moveToDirectory/2.0.0/index.ts new file mode 100644 index 0000000..eae65e6 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/moveToDirectory/2.0.0/index.ts @@ -0,0 +1,64 @@ +import { promises as fs } from 'fs'; +import { getContainer, getFileName } from '../../../../FlowHelpers/1.0.0/fileUtils'; +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Move To Directory', + description: 'Move working file to directory.', + style: { + borderColor: 'green', + }, + tags: '', + + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [ + { + name: 'outputDirectory', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Specify ouput directory', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args:IpluginInputArgs):Promise => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const originalFileName = getFileName(args.originalLibraryFile._id); + const newContainer = getContainer(args.inputFileObj._id); + + const outputPath = `${args.inputs.outputDirectory}/${originalFileName}.${newContainer}`; + + await fs.rename(args.inputFileObj._id, outputPath); + + return { + outputFileObj: { + _id: outputPath, + }, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/replaceOriginalFile/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/replaceOriginalFile/1.0.0/index.ts new file mode 100644 index 0000000..a3c478e --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/replaceOriginalFile/1.0.0/index.ts @@ -0,0 +1,77 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Replace Original File', + description: 'Replace the original file', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +const getNewPath = (originalPath:string, tempPath:string) => { + const tempPathParts = tempPath.split('.'); + const container = tempPathParts[tempPathParts.length - 1]; + + const originalPathParts = originalPath.split('.'); + + originalPathParts[originalPathParts.length - 1] = container; + + return originalPathParts.join('.'); +}; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args:IpluginInputArgs):Promise => { + const fs = require('fs'); + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const currentPath = args.inputFileObj._id; + const newPath = getNewPath(args.originalLibraryFile._id, currentPath); + const newPathTmp = `${newPath}.tmp`; + + args.jobLog(JSON.stringify({ + currentPath, + newPath, + newPathTmp, + })); + + await new Promise((resolve) => setTimeout(resolve, 2000)); + + fs.renameSync(currentPath, newPathTmp); + + if (fs.existsSync(newPath)) { + fs.unlinkSync(newPath); + } + + await new Promise((resolve) => setTimeout(resolve, 2000)); + fs.renameSync(newPathTmp, newPath); + + return { + outputFileObj: { + _id: newPath, + }, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/setOriginalFile/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/setOriginalFile/1.0.0/index.ts new file mode 100644 index 0000000..4ae3b77 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/setOriginalFile/1.0.0/index.ts @@ -0,0 +1,44 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Set Original File', + description: 'Set the working file to the original file', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: { + _id: args.originalLibraryFile._id, + }, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/file/unpack/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/file/unpack/1.0.0/index.ts new file mode 100644 index 0000000..fbff155 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/file/unpack/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Unpack File', + description: 'Unpack a file', + style: { + borderColor: 'green', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/handbrake/handbrakeCustomArguments/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/handbrake/handbrakeCustomArguments/1.0.0/index.ts new file mode 100644 index 0000000..3550a08 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/handbrake/handbrakeCustomArguments/1.0.0/index.ts @@ -0,0 +1,135 @@ +import { promises as fs } from 'fs'; +import { CLI } from '../../../../FlowHelpers/1.0.0/cliUtils'; +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'HandBrake Custom Arguments', + description: 'HandBrake Custom Arguments', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'customArguments', + type: 'string', + defaultValue: '-Z "Fast 1080p30" --all-subtitles', + inputUI: { + type: 'text', + }, + tooltip: 'Specify HandBrake arguments', + }, + { + name: 'jsonPreset', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: 'Paste a HandBrake JSON preset here. Leave blank to disable.', + }, + { + name: 'container', + type: 'string', + defaultValue: 'mkv', + inputUI: { + type: 'dropdown', + options: [ + 'mkv', + 'mp4', + 'm4v', + 'avi', + 'mov', + 'mpg', + 'mpeg', + ], + }, + tooltip: 'Specify HandBrake arguments', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args:IpluginInputArgs):Promise => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const customArguments = String(args.inputs.customArguments); + const container = String(args.inputs.container); + + const outputFilePath = `${args.workDir}/tempFile_${new Date().getTime()}.${container}`; + + const presetString = String(args.inputs.jsonPreset); + + const cliArgs = [ + '-i', + `${args.inputFileObj._id}`, + '-o', + `${outputFilePath}`, + ]; + + const presetPath = `${args.workDir}/preset.json`; + + if (presetString.trim() !== '') { + const preset = JSON.parse(presetString); + await fs.writeFile(presetPath, JSON.stringify(preset, null, 2)); + cliArgs.push('--preset-import-file'); + cliArgs.push(presetPath); + cliArgs.push('-Z'); + cliArgs.push(preset.PresetList[0].PresetName); + } else { + cliArgs.push(...args.deps.parseArgsStringToArgv(customArguments, '', '')); + } + + args.updateWorker({ + CLIType: args.handbrakePath, + preset: cliArgs.join(' '), + }); + + const cli = new CLI({ + cli: args.handbrakePath, + spawnArgs: cliArgs, + spawnOpts: {}, + jobLog: args.jobLog, + outputFilePath, + inputFileObj: args.inputFileObj, + logFullCliOutput: args.logFullCliOutput, + updateWorker: args.updateWorker, + }); + + const res = await cli.runCli(); + + if (res.cliExitCode !== 0) { + args.jobLog('Running HandBrake failed'); + throw new Error('Running HandBrake failed'); + } + + args.logOutcome('tSuc'); + + return { + outputFileObj: { + _id: outputFilePath, + }, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/input/inputFile/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/input/inputFile/1.0.0/index.ts new file mode 100644 index 0000000..299cab9 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/input/inputFile/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Input File', + description: 'Start the flow with an input file', + style: { + borderColor: 'pink', + }, + tags: '', + + isStartPlugin: true, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/failFlow/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/failFlow/1.0.0/index.ts new file mode 100644 index 0000000..7cccee8 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/failFlow/1.0.0/index.ts @@ -0,0 +1,39 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Fail Flow', + description: 'Force the flow to fail and be move to the error table', + style: { + borderColor: 'red', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faExclamationTriangle', + inputs: [], + outputs: [], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + throw new Error('Forcing flow to fail!'); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/goToFlow/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/goToFlow/1.0.0/index.ts new file mode 100644 index 0000000..235ab75 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/goToFlow/1.0.0/index.ts @@ -0,0 +1,38 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Go To Flow', + description: 'Go to a different flow', + style: { + borderColor: 'red', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [], + outputs: [], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/runMkvPropEdit/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/runMkvPropEdit/1.0.0/index.ts new file mode 100644 index 0000000..1b39283 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/runMkvPropEdit/1.0.0/index.ts @@ -0,0 +1,67 @@ +import { CLI } from '../../../../FlowHelpers/1.0.0/cliUtils'; +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Run MKVPropEdit', + description: 'Run MKVPropEdit on a file to update metadata which' + + ' FFmpeg doesn\'t typically update such as stream bitrate.', + style: { + borderColor: 'green', + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = async (args:IpluginInputArgs):Promise => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const cliArgs = [ + '--add-track-statistics-tags', + args.inputFileObj._id, + ]; + + const cli = new CLI({ + cli: args.mkvpropeditPath, + spawnArgs: cliArgs, + spawnOpts: {}, + jobLog: args.jobLog, + outputFilePath: '', + inputFileObj: args.inputFileObj, + logFullCliOutput: args.logFullCliOutput, + updateWorker: args.updateWorker, + }); + + const res = await cli.runCli(); + + if (res.cliExitCode !== 0) { + args.jobLog('Running MKVPropEdit failed'); + throw new Error('Running MKVPropEdit failed'); + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/webRequest/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/webRequest/1.0.0/index.ts new file mode 100644 index 0000000..4026f12 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/webRequest/1.0.0/index.ts @@ -0,0 +1,43 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Send Web Request', + description: 'Send Web Request', + style: { + borderColor: 'green', + opacity: 0.5, + }, + tags: '', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faArrowRight', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/check10Bit/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/video/check10Bit/1.0.0/index.ts new file mode 100644 index 0000000..88ac7e9 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/video/check10Bit/1.0.0/index.ts @@ -0,0 +1,55 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Check 10 Bit Video', + description: 'Check if a file is 10 bit video', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'File is 10 bit video', + }, + { + number: 2, + tooltip: 'File is not 10 bit video', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + let is10Bit = false; + + for (let i = 0; i < args.variables.ffmpegCommand.streams.length; i += 1) { + const stream = args.variables.ffmpegCommand.streams[i]; + if (stream.codec_type === 'video' && stream.bits_per_raw_sample === 10) { + is10Bit = true; + } + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: is10Bit ? 1 : 2, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoBitrate/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoBitrate/1.0.0/index.ts new file mode 100644 index 0000000..45c75d2 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoBitrate/1.0.0/index.ts @@ -0,0 +1,102 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = (): IpluginDetails => ({ + name: 'Check Video Bitrate', + description: 'Check if video bitrate is within a specific range', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'unit', + type: 'string', + defaultValue: 'kbps', + inputUI: { + type: 'dropdown', + options: [ + 'bps', + 'kbps', + 'mbps', + ], + }, + tooltip: 'Specify the unit to use', + }, + { + name: 'greaterThan', + type: 'number', + defaultValue: '0', + inputUI: { + type: 'text', + }, + tooltip: 'Specify lower bound', + }, + { + name: 'lessThan', + type: 'number', + defaultValue: '10000', + inputUI: { + type: 'text', + }, + tooltip: 'Specify upper bound', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File within range', + }, + { + number: 2, + tooltip: 'File not within range', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args: IpluginInputArgs): IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + let isWithinRange = false; + + let greaterThanBits = Number(args.inputs.greaterThan); + let lessThanBits = Number(args.inputs.lessThan); + + if (args.inputs.unit === 'kbps') { + greaterThanBits *= 1000; + lessThanBits *= 1000; + } else if (args.inputs.unit === 'mbps') { + greaterThanBits *= 1000000; + lessThanBits *= 1000000; + } + + if (args.inputFileObj?.mediaInfo?.track) { + args.inputFileObj.mediaInfo.track.forEach((stream) => { + if (stream['@type'] === 'video') { + if (stream.BitRate >= greaterThanBits && stream.BitRate <= lessThanBits) { + isWithinRange = true; + } + } + }); + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: isWithinRange ? 1 : 2, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoCodec/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoCodec/1.0.0/index.ts new file mode 100644 index 0000000..946ecf8 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoCodec/1.0.0/index.ts @@ -0,0 +1,72 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Check Video Codec', + description: 'Check if a file has a specific video codec', + style: { + borderColor: 'orange', + }, + tags: 'video', + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [ + { + name: 'codec', + type: 'string', + defaultValue: 'hevc', + inputUI: { + type: 'dropdown', + options: [ + 'hevc', + 'vp9', + 'h264', + 'vp8', + ], + }, + tooltip: 'Specify the codec check for', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'File has codec', + }, + { + number: 2, + tooltip: 'File does not have codec', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + let hasCodec = false; + + if (args.inputFileObj.ffProbeData.streams) { + args.inputFileObj.ffProbeData.streams.forEach((stream) => { + if (stream.codec_type === 'video' && stream.codec_name === args.inputs.codec) { + hasCodec = true; + } + }); + } + + return { + outputFileObj: args.inputFileObj, + outputNumber: hasCodec ? 1 : 2, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoResolution/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoResolution/1.0.0/index.ts new file mode 100644 index 0000000..cc38a4e --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/video/checkVideoResolution/1.0.0/index.ts @@ -0,0 +1,75 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Check Video Resolution', + description: 'Check is video is 480p,576p,720p,1080p,1440p,4KUHD,DCI4K,8KUHD,Other', + style: { + borderColor: 'orange', + }, + tags: 'video', + + isStartPlugin: false, + sidebarPosition: -1, + icon: 'faQuestion', + inputs: [], + outputs: [ + { + number: 1, + tooltip: 'File is 480p', + }, + { + number: 2, + tooltip: 'File is 576p', + }, + { + number: 3, + tooltip: 'File is 720p', + }, + { + number: 4, + tooltip: 'File is 1080p', + }, + { + number: 5, + tooltip: 'File is 1440p', + }, + { + number: 6, + tooltip: 'File is 4KUHD', + }, + { + number: 7, + tooltip: 'File is DCI4K', + }, + { + number: 8, + tooltip: 'File is 8KUHD', + }, + { + number: 9, + tooltip: 'File is Other', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + return { + outputFileObj: args.inputFileObj, + outputNumber: 1, + variables: args.variables, + }; +}; +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.ts new file mode 100644 index 0000000..4fbfd44 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowPlugins/video/transcodeVideo/1.0.0/index.ts @@ -0,0 +1,72 @@ +import { + IpluginDetails, + IpluginInputArgs, + IpluginOutputArgs, +} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces'; + +/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +const details = ():IpluginDetails => ({ + name: 'Transcode Video File', + description: 'Transcode a video file using ffmpeg. GPU transcoding will be used if possible.', + style: { + borderColor: '#6efefc', + opacity: 0.5, + }, + tags: '', + + isStartPlugin: false, + sidebarPosition: -1, + icon: '', + inputs: [ + { + name: 'target_codec', + type: 'string', + defaultValue: 'hevc', + inputUI: { + type: 'dropdown', + options: [ + 'hevc', + // 'vp9', + 'h264', + // 'vp8', + ], + }, + tooltip: 'Specify the codec to use', + }, + ], + outputs: [ + { + number: 1, + tooltip: 'Continue to next plugin', + }, + ], +}); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const plugin = (args:IpluginInputArgs):IpluginOutputArgs => { + const lib = require('../../../../../methods/lib')(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + args.inputs = lib.loadDefaultValues(args.inputs, details); + + const fs = require('fs'); + + const oldFile = args.inputFileObj._id; + const newFile = `${args.inputFileObj._id}.tmp`; + + if (fs.existsSync(newFile)) { + fs.unlinkSync(newFile); + } + + fs.copyFileSync(oldFile, newFile); + + return { + outputFileObj: { _id: newFile }, + outputNumber: 1, + variables: args.variables, + }; +}; + +export { + details, + plugin, +}; diff --git a/FlowPluginsTs/CommunityFlowPlugins/video/transcodeVideo/1.0.0/test.ts b/FlowPluginsTs/CommunityFlowPlugins/video/transcodeVideo/1.0.0/test.ts new file mode 100644 index 0000000..e69de29 diff --git a/FlowPluginsTs/CommunityFlowTemplates/video/basicVideo.ts b/FlowPluginsTs/CommunityFlowTemplates/video/basicVideo.ts new file mode 100644 index 0000000..1acb5a4 --- /dev/null +++ b/FlowPluginsTs/CommunityFlowTemplates/video/basicVideo.ts @@ -0,0 +1,131 @@ +const details = () => ({ + name: 'Basic HEVC Video Flow', + description: 'Flow description', + tags: 'video', + flowPlugins: [ + { + name: 'Input File', + sourceRepo: 'Community', + pluginName: 'inputFile', + version: '1.0.0', + id: 'pE6rU7gkW', + position: { + x: 758.5809635618224, + y: 117.19206188888086, + }, + }, + { + name: 'Check if hevc', + sourceRepo: 'Community', + pluginName: 'checkVideoCodec', + version: '1.0.0', + id: '91b7IrsEc', + position: { + x: 672.4549563302081, + y: 253.11148102973914, + }, + }, + { + name: 'Start', + sourceRepo: 'Community', + pluginName: 'ffmpegCommandStart', + version: '1.0.0', + id: '4Swd6qzvc', + position: { + x: 499.4549563302081, + y: 367.1114810297392, + }, + }, + { + name: 'Execute', + sourceRepo: 'Community', + pluginName: 'ffmpegCommandExecute', + version: '1.0.0', + id: '450g167D8', + position: { + x: 496.4549563302081, + y: 653.1114810297393, + }, + }, + { + name: 'Set Video Encoder', + sourceRepo: 'Community', + pluginName: 'ffmpegCommandSetVideoEncoder', + version: '1.0.0', + id: '8B_6pRd_U', + position: { + x: 498.4549563302081, + y: 527.1114810297393, + }, + }, + { + name: 'Replace Original File', + sourceRepo: 'Community', + pluginName: 'replaceOriginalFile', + version: '1.0.0', + id: '4fkfOyR3l', + position: { + x: 820.4549563302082, + y: 742.2114810297393, + }, + }, + ], + flowEdges: [ + { + source: 'pE6rU7gkW', + sourceHandle: '1', + target: '91b7IrsEc', + targetHandle: null, + id: 'HhF4rw2DZ', + animated: true, + type: 'smoothstep', + }, + { + source: '91b7IrsEc', + sourceHandle: '2', + target: '4Swd6qzvc', + targetHandle: null, + id: 'jJizyFUcr', + animated: true, + type: 'smoothstep', + }, + { + source: '4Swd6qzvc', + sourceHandle: '1', + target: '8B_6pRd_U', + targetHandle: null, + id: '3Df7Xoy93', + animated: true, + type: 'smoothstep', + }, + { + source: '8B_6pRd_U', + sourceHandle: '1', + target: '450g167D8', + targetHandle: null, + id: 'BQerEKase', + animated: true, + type: 'smoothstep', + }, + { + source: '450g167D8', + sourceHandle: '1', + target: '4fkfOyR3l', + targetHandle: null, + id: 'rE5Dsh9KM', + animated: true, + type: 'smoothstep', + }, + { + source: '91b7IrsEc', + sourceHandle: '1', + target: '4fkfOyR3l', + targetHandle: null, + id: 'W2nVG7ts5', + animated: true, + type: 'smoothstep', + }, + ], +}); + +module.exports.details = details; diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/cliParsers.ts b/FlowPluginsTs/FlowHelpers/1.0.0/cliParsers.ts new file mode 100644 index 0000000..a9604d9 --- /dev/null +++ b/FlowPluginsTs/FlowHelpers/1.0.0/cliParsers.ts @@ -0,0 +1,204 @@ +const handbrakeParser = ({ + str, +}: + { + str: string + }): number => { + if (typeof str !== 'string') { + return 0; + } + + let percentage = 0; + const numbers = '0123456789'; + const n = str.indexOf('%'); + + if ( + str.length >= 6 + && str.indexOf('%') >= 6 + && numbers.includes(str.charAt(n - 5)) + ) { + let output: string = str.substring(n - 6, n + 1); + const outputArr: string[] = output.split(''); + outputArr.splice(outputArr.length - 1, 1); + output = outputArr.join(''); + + const outputNum = Number(output); + if (outputNum > 0) { + percentage = outputNum; + } + } + + return percentage; +}; + +// frame= 889 fps=106 q=26.0 Lsize= 25526kB time=00:00:35.69 bitrate=5858.3kbits/s speed=4.25x +const getFFmpegVar = ({ + str, + variable, +}: { + str: string, variable: string +}): string => { + if (typeof str !== 'string') { + return ''; + } + + const idx = str.indexOf(variable); + + let out = ''; + let initSpacesEnded = false; + + if (idx >= 0) { + const startIdx = idx + variable.length + 1; + for (let i = startIdx; i < str.length; i += 1) { + if (initSpacesEnded === true && str[i] === ' ') { + break; + } else if (initSpacesEnded === false && str[i] !== ' ') { + initSpacesEnded = true; + } + + if (initSpacesEnded === true && str[i] !== ' ') { + out += str[i]; + } + } + } + + return out; +}; + +const getFFmpegPercentage = ({ + f, + fc, + vf, + d, +}: { + + f: string, fc: number, vf: number, d: number +}): number => { + let frameCount01: number = fc; + let VideoFrameRate: number = vf; + let Duration: number = d; + + let perc = 0; + + const frame: number = parseInt(f, 10); + frameCount01 = Math.ceil(frameCount01); + VideoFrameRate = Math.ceil(VideoFrameRate); + Duration = Math.ceil(Duration); + + if (frameCount01 > 0) { + perc = ((frame / frameCount01) * 100); + } else if (VideoFrameRate > 0 && Duration > 0) { + perc = ((frame / (VideoFrameRate * Duration)) * 100); + } else { + perc = (frame); + } + + const percString = perc.toFixed(2); + + // eslint-disable-next-line no-restricted-globals + if (isNaN(perc)) { + return 0.00; + } + + return parseFloat(percString); +}; + +const ffmpegParser = ({ + str, + frameCount, + + videoFrameRate, + ffprobeDuration, + metaDuration, +}: { + str: string, + frameCount: number, + + videoFrameRate: number | undefined, + ffprobeDuration: string | undefined, + metaDuration: number | undefined, +}): number => { + if (typeof str !== 'string') { + return 0; + } + + let percentage = 0; + if (str.length >= 6) { + const n = str.indexOf('fps'); + + if (n >= 6) { + // get frame + const frame = getFFmpegVar({ + str, + variable: 'frame', + }); + + const frameRate = videoFrameRate || 0; + let duration = 0; + + if ( + ffprobeDuration + && parseFloat(ffprobeDuration) > 0 + ) { + duration = parseFloat(ffprobeDuration); + } else if (metaDuration) { + duration = metaDuration; + } + + const per = getFFmpegPercentage( + { + f: frame, + fc: frameCount, + vf: frameRate, + d: duration, + }, + ); + + const outputNum = Number(per); + if (outputNum > 0) { + percentage = outputNum; + } + } + } + + return percentage; +}; + +const editreadyParser = ({ str }:{str: string}): number => { + if (typeof str !== 'string') { + return 0; + } + let percentage = 0; + + // const ex = 'STATUS: {"progress": "0.0000000"}'; + + if (str.includes('STATUS:')) { + const parts = str.split('STATUS:'); + + if (parts[1]) { + try { + const json = JSON.parse(parts[1]); + const progress = parseFloat(json.progress); + const percStr = (progress * 100).toFixed(2); + percentage = parseFloat(percStr); + } catch (err) { + // err + } + } + } + + // eslint-disable-next-line no-restricted-globals + if (isNaN(percentage)) { + return 0.00; + } + + return percentage; +}; + +export { + handbrakeParser, + ffmpegParser, + getFFmpegPercentage, + getFFmpegVar, + editreadyParser, +}; diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/cliUtils.ts b/FlowPluginsTs/FlowHelpers/1.0.0/cliUtils.ts new file mode 100644 index 0000000..30025ff --- /dev/null +++ b/FlowPluginsTs/FlowHelpers/1.0.0/cliUtils.ts @@ -0,0 +1,300 @@ +import { editreadyParser, ffmpegParser, handbrakeParser } from './cliParsers'; +import { Ilog, IupdateWorker } from './interfaces/interfaces'; +import { IFileObject, Istreams } from './interfaces/synced/IFileObject'; + +const fs = require('fs'); + +const fancyTimeFormat = (time: number) => { + // Hours, minutes and seconds + + // eslint-disable-next-line no-bitwise + const hrs = ~~(time / 3600); + // eslint-disable-next-line no-bitwise + const mins = ~~((time % 3600) / 60); + // eslint-disable-next-line no-bitwise + const secs = ~~time % 60; + + // Output like "1:01" or "4:03:59" or "123:03:59" + let ret = ''; + + // if (hrs > 0) { + ret += `${hrs}:${mins < 10 ? '0' : ''}`; + // } + + ret += `${mins}:${secs < 10 ? '0' : ''}`; + ret += `${secs}`; + return ret; +}; + +// frame= 889 fps=106 q=26.0 Lsize= 25526kB time=00:00:35.69 bitrate=5858.3kbits/s speed=4.25x +export const getFFmpegVar = ({ + str, + variable, +}: { + str: string, variable: string +}): string => { + if (typeof str !== 'string') { + return ''; + } + + const idx = str.indexOf(variable); + + let out = ''; + let initSpacesEnded = false; + + if (idx >= 0) { + const startIdx = idx + variable.length + 1; + for (let i = startIdx; i < str.length; i += 1) { + if (initSpacesEnded === true && str[i] === ' ') { + break; + } else if (initSpacesEnded === false && str[i] !== ' ') { + initSpacesEnded = true; + } + + if (initSpacesEnded === true && str[i] !== ' ') { + out += str[i]; + } + } + } + + return out; +}; + +interface Iconfig { + cli: string, + spawnArgs: string[], + spawnOpts: Record, + jobLog: Ilog, + outputFilePath: string, + updateWorker: IupdateWorker, + logFullCliOutput: boolean, + inputFileObj: IFileObject, +} + +class CLI { + // @ts-expect-error init + config: Iconfig = {}; + + progAVG: number[] = []; + + oldOutSize = 0; + + oldEstSize = 0; + + oldProgress = 0; + + lastProgCheck = 0; + + constructor(config: Iconfig) { + this.config = config; + } + + updateETA = (perc: number): void => { + if (perc > 0) { + if (this.lastProgCheck === 0) { + this.lastProgCheck = new Date().getTime(); + this.oldProgress = perc; + } else if (perc !== this.oldProgress) { + const n = new Date().getTime(); + const secsSinceLastCheck = (n - this.lastProgCheck) / 1000; + + if (secsSinceLastCheck > 1) { + // eta total + let eta = Math.round( + (100 / (perc - this.oldProgress)) * secsSinceLastCheck, + ); + + // eta remaining + eta *= ((100 - perc) / 100); + this.progAVG.push(eta); + + // let values = [2, 56, 3, 41, 0, 4, 100, 23]; + const sum = this.progAVG.reduce( + // eslint-disable-next-line + (previous, current) => (current += previous), + ); + const avg = sum / this.progAVG.length; + + // est size + let estSize = 0; + + let outputFileSizeInGbytes; + + try { + if (fs.existsSync(this.config.outputFilePath)) { + let singleFileSize = fs.statSync(this.config.outputFilePath); + singleFileSize = singleFileSize.size; + outputFileSizeInGbytes = singleFileSize / (1024 * 1024 * 1024); + + if (outputFileSizeInGbytes !== this.oldOutSize) { + this.oldOutSize = outputFileSizeInGbytes; + estSize = outputFileSizeInGbytes + + ((100 - perc) / perc) * outputFileSizeInGbytes; + this.oldEstSize = estSize; + } + } + } catch (err) { + // eslint-disable-next-line no-console + console.log(err); + } + + this.config.updateWorker({ + ETA: fancyTimeFormat(avg), + outputFileSizeInGbytes: outputFileSizeInGbytes === undefined ? 0 : outputFileSizeInGbytes, + estSize: this.oldEstSize === undefined ? 0 : this.oldEstSize, + }); + + if (this.progAVG.length > 30) { + this.progAVG.splice(0, 1); + } + + this.lastProgCheck = n; + this.oldProgress = perc; + } + } + } + }; + + parseOutput = (data: string): void => { + const str = `${data}`; + // + if (this.config.logFullCliOutput === true) { + this.config.jobLog(str); + } + + if (this.config.cli.toLowerCase().includes('handbrake')) { + const percentage = handbrakeParser({ + str, + }); + if (percentage > 0) { + this.updateETA(percentage); + this.config.updateWorker({ + percentage, + }); + } + } else if (this.config.cli.toLowerCase().includes('ffmpeg')) { + const n = str.indexOf('fps'); + const shouldUpdate = str.length >= 6 && n >= 6; + + const fps = parseInt(getFFmpegVar({ + str, + variable: 'fps', + }), 10); + + let frameCount = 0; + + try { + // @ts-expect-error type + const frameCountTmp = this.config.inputFileObj.ffProbeData?.streams + .filter((row: Istreams) => row.codec_type === 'video')[0].nb_frames; + + if (frameCountTmp + // @ts-expect-error type + && !isNaN(frameCountTmp)) { // eslint-disable-line no-restricted-globals + // @ts-expect-error type + frameCount = frameCountTmp; + } + } catch (err) { + // err + } + + const percentage = ffmpegParser({ + str, + frameCount, + videoFrameRate: this.config.inputFileObj?.meta?.VideoFrameRate, + ffprobeDuration: this.config.inputFileObj.ffProbeData?.format?.duration, + metaDuration: this.config.inputFileObj?.meta?.Duration, + }); + + if (shouldUpdate === true && fps > 0) { + this.config.updateWorker({ + fps, + }); + } + + if (shouldUpdate === true && percentage > 0) { + this.updateETA(percentage); + this.config.updateWorker({ + percentage, + }); + } + } else if (this.config.cli.toLowerCase().includes('editready')) { + const percentage = editreadyParser({ + str, + }); + if (percentage > 0) { + this.updateETA(percentage); + this.config.updateWorker({ + percentage, + }); + } + } + }; + + runCli = async (): Promise<{ + cliExitCode: number, + errorLogFull: string[], + }> => { + const childProcess = require('child_process'); + + const errorLogFull: string[] = []; + + // eslint-disable-next-line no-console + this.config.jobLog(`Running ${this.config.cli} ${this.config.spawnArgs.join(' ')}`); + const cliExitCode: number = await new Promise((resolve) => { + try { + const opts = this.config.spawnOpts || {}; + const thread = childProcess.spawn(this.config.cli, this.config.spawnArgs, opts); + + thread.stdout.on('data', (data: string) => { + // eslint-disable-next-line no-console + // console.log(data.toString()); + errorLogFull.push(data.toString()); + this.parseOutput(data); + }); + + thread.stderr.on('data', (data: string) => { + // eslint-disable-next-line no-console + // console.log(data.toString()); + errorLogFull.push(data.toString()); + this.parseOutput(data); + }); + + thread.on('error', () => { + // catches execution error (bad file) + // eslint-disable-next-line no-console + console.log(1, `Error executing binary: ${this.config.cli}`); + resolve(1); + }); + + // thread.stdout.pipe(process.stdout); + // thread.stderr.pipe(process.stderr); + thread.on('close', (code: number) => { + if (code !== 0) { + // eslint-disable-next-line no-console + console.log(code, 'CLI error'); + } + resolve(code); + }); + } catch (err) { + // catches execution error (no file) + // eslint-disable-next-line no-console + console.log(1, `Error executing binary: ${this.config.cli}`); + resolve(1); + } + }); + + if (!this.config.logFullCliOutput) { + this.config.jobLog(errorLogFull.slice(-1000).join('')); + } + + return { + cliExitCode, + errorLogFull, + }; + }; +} + +export { + CLI, +}; diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/fileUtils.ts b/FlowPluginsTs/FlowHelpers/1.0.0/fileUtils.ts new file mode 100644 index 0000000..08e122e --- /dev/null +++ b/FlowPluginsTs/FlowHelpers/1.0.0/fileUtils.ts @@ -0,0 +1,13 @@ +export const getContainer = (filePath: string):string => { + const parts = filePath.split('.'); + return parts[parts.length - 1]; +}; + +export const getFileName = (filePath: string):string => { + const parts = filePath.split('/'); + const fileNameAndContainer = parts[parts.length - 1]; + const parts2 = fileNameAndContainer.split('.'); + return parts2[0]; +}; + +export const getFfType = (codecType:string):string => (codecType === 'video' ? 'v' : 'a'); diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/hardwareUtils.test.ts b/FlowPluginsTs/FlowHelpers/1.0.0/hardwareUtils.test.ts new file mode 100644 index 0000000..f1cfa1c --- /dev/null +++ b/FlowPluginsTs/FlowHelpers/1.0.0/hardwareUtils.test.ts @@ -0,0 +1,24 @@ +import { getEncoder } from './hardwareUtils'; + +const run = async () => { + const encoderProperties = await getEncoder({ + targetCodec: 'h264', + hardwareEncoding: true, + // @ts-expect-error type + args: { + workerType: 'transcodegpu', + ffmpegPath: 'ffmpeg', + jobLog: (t:string) => { + // eslint-disable-next-line no-console + console.log(t); + }, + }, + }); + + // eslint-disable-next-line no-console + console.log({ + encoderProperties, + }); +}; + +void run(); diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/hardwareUtils.ts b/FlowPluginsTs/FlowHelpers/1.0.0/hardwareUtils.ts new file mode 100644 index 0000000..47cc3b1 --- /dev/null +++ b/FlowPluginsTs/FlowHelpers/1.0.0/hardwareUtils.ts @@ -0,0 +1,293 @@ +import { IpluginInputArgs } from './interfaces/interfaces'; + +export const hasEncoder = async ({ + ffmpegPath, + encoder, + inputArgs, + filter, +}: { + ffmpegPath: string, + encoder: string, + inputArgs: string[], + filter: string, +}): Promise => { + const { exec } = require('child_process'); + let isEnabled = false; + try { + isEnabled = await new Promise((resolve) => { + const command = `${ffmpegPath} ${inputArgs.join(' ') || ''} -f lavfi -i color=c=black:s=256x256:d=1:r=30` + + ` ${filter || ''}` + + ` -c:v ${encoder} -f null /dev/null`; + exec(command, ( + // eslint-disable-next-line + error: any, + // stdout, + // stderr, + ) => { + if (error) { + resolve(false); + return; + } + resolve(true); + }); + }); + } catch (err) { + // eslint-disable-next-line no-console + console.log(err); + } + + return isEnabled; +}; + +interface IgpuEncoder { + encoder: string, + enabled: boolean, + + inputArgs: string[], + outputArgs: string[], + filter: string, +} + +// credit to UNCode101 for this +export const getBestNvencDevice = ({ + args, + nvencDevice, +}: { + args: IpluginInputArgs + nvencDevice: IgpuEncoder, +}): IgpuEncoder => { + const { execSync } = require('child_process'); + let gpu_num = -1; + let lowest_gpu_util = 100000; + let result_util = 0; + let gpu_count = -1; + let gpu_names = ''; + const gpus_to_exclude: string[] = []; + // inputs.exclude_gpus === '' ? [] : inputs.exclude_gpus.split(',').map(Number); + try { + gpu_names = execSync('nvidia-smi --query-gpu=name --format=csv,noheader'); + gpu_names = gpu_names.toString().trim(); + const gpu_namesArr = gpu_names.split(/\r?\n/); + /* When nvidia-smi returns an error it contains 'nvidia-smi' in the error + Example: Linux: nvidia-smi: command not found + Windows: 'nvidia-smi' is not recognized as an internal or external command, + operable program or batch file. */ + if (!gpu_namesArr[0].includes('nvidia-smi')) { + gpu_count = gpu_namesArr.length; + } + } catch (error) { + args.jobLog('Error in reading nvidia-smi output! \n'); + } + + if (gpu_count > 0) { + for (let gpui = 0; gpui < gpu_count; gpui += 1) { + // Check if GPU # is in GPUs to exclude + if (gpus_to_exclude.includes(String(gpui))) { + args.jobLog(`GPU ${gpui}: ${gpu_names[gpui]} is in exclusion list, will not be used!\n`); + } else { + try { + const cmd_gpu = `nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits -i ${gpui}`; + result_util = parseInt(execSync(cmd_gpu), 10); + if (!Number.isNaN(result_util)) { // != "No devices were found") { + args.jobLog(`GPU ${gpui} : Utilization ${result_util}%\n`); + + if (result_util < lowest_gpu_util) { + gpu_num = gpui; + lowest_gpu_util = result_util; + } + } + } catch (error) { + args.jobLog(`Error in reading GPU ${gpui} Utilization\nError: ${error}\n`); + } + } + } + } + if (gpu_num >= 0) { + // eslint-disable-next-line no-param-reassign + nvencDevice.inputArgs.push('-hwaccel_device', `${gpu_num}`); + // eslint-disable-next-line no-param-reassign + nvencDevice.outputArgs.push('-gpu', `${gpu_num}`); + } + + return nvencDevice; +}; + +const encoderFilter = (encoder:string, targetCodec:string) => { + if (targetCodec === 'hevc' && (encoder.includes('hevc') || encoder.includes('h265'))) { + return true; + } if (targetCodec === 'h264' && encoder.includes('h264')) { + return true; + } + + return false; +}; + +export const getEncoder = async ({ + targetCodec, + hardwareEncoding, + args, +}: { + targetCodec: string, + hardwareEncoding: boolean, + args: IpluginInputArgs, +}): Promise<{ + encoder: string, + inputArgs: string[], + outputArgs: string[], + isGpu: boolean, +}> => { + if ( + args.workerType + && args.workerType.includes('gpu') + && hardwareEncoding && (targetCodec === 'hevc' || targetCodec === 'h264')) { + const gpuEncoders: IgpuEncoder[] = [ + { + encoder: 'hevc_nvenc', + enabled: false, + inputArgs: [ + '-hwaccel', + 'cuda', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'hevc_amf', + enabled: false, + inputArgs: [], + outputArgs: [], + filter: '', + }, + { + encoder: 'hevc_vaapi', + inputArgs: [ + '-hwaccel', + 'vaapi', + '-hwaccel_device', + '/dev/dri/renderD128', + '-hwaccel_output_format', + 'vaapi', + ], + outputArgs: [], + enabled: false, + filter: '-vf format=nv12,hwupload', + }, + { + encoder: 'hevc_qsv', + enabled: false, + inputArgs: [ + '-hwaccel', + 'qsv', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'hevc_videotoolbox', + enabled: false, + inputArgs: [ + '-hwaccel', + 'videotoolbox', + ], + outputArgs: [], + filter: '', + }, + + { + encoder: 'h264_nvenc', + enabled: false, + inputArgs: [ + '-hwaccel', + 'cuda', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'h264_amf', + enabled: false, + inputArgs: [], + outputArgs: [], + filter: '', + }, + { + encoder: 'h264_qsv', + enabled: false, + inputArgs: [ + '-hwaccel', + 'qsv', + ], + outputArgs: [], + filter: '', + }, + { + encoder: 'h264_videotoolbox', + enabled: false, + inputArgs: [ + '-hwaccel', + 'videotoolbox', + ], + outputArgs: [], + filter: '', + }, + ]; + + const filteredGpuEncoders = gpuEncoders.filter((device) => encoderFilter(device.encoder, targetCodec)); + + // eslint-disable-next-line no-restricted-syntax + for (const gpuEncoder of filteredGpuEncoders) { + // eslint-disable-next-line no-await-in-loop + gpuEncoder.enabled = await hasEncoder({ + ffmpegPath: args.ffmpegPath, + encoder: gpuEncoder.encoder, + inputArgs: gpuEncoder.inputArgs, + filter: gpuEncoder.filter, + }); + } + + const enabledDevices = gpuEncoders.filter((device) => device.enabled === true); + + if (enabledDevices.length > 0) { + if (enabledDevices[0].encoder.includes('nvenc')) { + const res = getBestNvencDevice({ + args, + nvencDevice: enabledDevices[0], + }); + + return { + ...res, + isGpu: true, + }; + } + return { + encoder: enabledDevices[0].encoder, + inputArgs: enabledDevices[0].inputArgs, + outputArgs: enabledDevices[0].outputArgs, + isGpu: true, + }; + } + } + + if (targetCodec === 'hevc') { + return { + encoder: 'libx265', + inputArgs: [], + outputArgs: [], + isGpu: false, + }; + } if (targetCodec === 'h264') { + return { + encoder: 'libx264', + inputArgs: [], + outputArgs: [], + isGpu: false, + }; + } + + return { + encoder: targetCodec, + inputArgs: [], + outputArgs: [], + isGpu: false, + }; +}; diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts b/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts new file mode 100644 index 0000000..86c649a --- /dev/null +++ b/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts @@ -0,0 +1,119 @@ +import { IFileObject, Istreams } from './synced/IFileObject'; +import Ijob from './synced/jobInterface'; + +export interface IpluginInputUi { + type: 'dropdown' | 'text' | 'textarea', + options?: string[], + style?:Record, + onSelect?: { + 'hevc': { + update: { + quality: '28', + }, + } + }, +} + +export interface IpluginInputs { + name: string, + type: 'string' | 'boolean' | 'number', + defaultValue: string, + inputUI: IpluginInputUi, + tooltip: string, +} + +export interface IpluginDetails { + name: string, + description: string, + style: { + borderColor: string, + opacity?: number, + }, + tags: string, + isStartPlugin: boolean, + sidebarPosition: number, + icon: string, + inputs: IpluginInputs[], + + outputs: { + number: number, + tooltip: string, + }[], +} + +export interface Ilog { + (text: string): void +} + +export interface IupdateWorker { + (obj: Record): void, +} + +export interface IffmpegCommandStream extends Istreams { + removed: boolean, + forceEncoding: boolean, + inputArgs: string[], + outputArgs: string[], +} + +export interface IffmpegCommand { + inputFiles: string[], + streams: IffmpegCommandStream[] + container: string, + hardwareDecoding: boolean, + shouldProcess: boolean, + overallInputArguments: string[], + overallOuputArguments: string[], +} + +export interface Ivariables { + ffmpegCommand: IffmpegCommand +} + +export interface IpluginOutputArgs { + outputNumber: number, + outputFileObj: { + _id: string, + }, + variables: Ivariables +} + +export interface IpluginInputArgs { + inputFileObj: IFileObject, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + librarySettings: any, + inputs: Record, + jobLog: Ilog, + workDir: string, + platform: string, + arch: string, + handbrakePath: string, + ffmpegPath: string, + mkvpropeditPath: string, + originalLibraryFile: IFileObject, + nodeHardwareType: string, + workerType: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + config: any, + job: Ijob, + platform_arch_isdocker: string, + variables: Ivariables, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + lastSuccesfulPlugin: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + lastSuccessfulRun: any, + updateWorker: IupdateWorker, + logFullCliOutput: boolean, + logOutcome: (outcome: string) => void, + deps: { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + fsextra: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + parseArgsStringToArgv: any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + importFresh(path: string): any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + axiosMiddleware: (endpoint: string, data: Record) => Promise, + requireFromString: (pluginText: string, relativePath:string) => Record, + }, +} diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/synced/IFileObject.ts b/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/synced/IFileObject.ts new file mode 100644 index 0000000..6c36a2c --- /dev/null +++ b/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/synced/IFileObject.ts @@ -0,0 +1,198 @@ +export interface IstatSync { // tlint-disable-line statSync + mtimeMs: number, + ctimeMs: number, + + ctime?: '', + mtime?: '', + atime?: '', +} + +export interface Itags { + language?: string, + title?: string, + [key:string]: string | undefined, +} +export interface Istreams { + codec_name: string; + codec_type: string, + bit_rate?: number, + channels?: number, + tags?: Itags, + avg_frame_rate?: string, + nb_frames?: string, + + duration?: number; + width?: number, + height?: number, + // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-module-boundary-types + [index: string]: any +} + +export interface Iformat { + 'filename'?: string, + 'nb_streams'?: number, + 'nb_programs'?: number, + 'format_name'?: string, + 'format_long_name'?: string, + 'start_time'?: string, + 'duration'?: string, + 'size'?: string, + 'bit_rate'?: string, + 'probe_score'?: number, + [key:string]: string | number | undefined + } + +export interface IffProbeData { + streams?: Istreams[] + format?: Iformat +} + +export interface Imeta { + TrackDuration?: number, + MediaDuration?: number, + 'SourceFile'?: string, + 'errors'?: [], + 'Duration'?: number, + 'ExifToolVersion'?: number, + 'FileName'?: string, + 'Directory'?: string, + 'FileSize'?: string, + 'FileModifyDate'?: { + 'year'?: number, + 'month'?: number, + 'day'?: number, + 'hour'?: number, + 'minute'?: number, + 'second'?: number, + 'millisecond'?: number, + 'tzoffsetMinutes'?: number, + 'rawValue'?: string, + }, + 'FileAccessDate'?: { + 'year'?: number, + 'month'?: number, + 'day'?: number, + 'hour'?: number, + 'minute'?: number, + 'second'?: number, + 'millisecond'?: number, + 'tzoffsetMinutes'?: number, + 'rawValue'?: string, + }, + 'FileCreateDate'?: { + 'year'?: number, + 'month'?: number, + 'day'?: number, + 'hour'?: number, + 'minute'?: number, + 'second'?: number, + 'millisecond'?: number, + 'tzoffsetMinutes'?: number, + 'rawValue'?: string, + }, + 'FilePermissions'?: string, + 'FileType'?: string, + 'FileTypeExtension'?: string, + 'MIMEType'?: string, + 'EBMLVersion'?: 1, + 'EBMLReadVersion'?: 1, + 'DocType'?: string, + 'DocTypeVersion'?: 4, + 'DocTypeReadVersion'?: 2, + 'TimecodeScale'?: string, + 'MuxingApp'?: string, + 'WritingApp'?: string, + 'VideoFrameRate'?: number, + 'ImageWidth'?: number, + 'ImageHeight'?: number, + 'TrackNumber'?: number, + 'TrackLanguage'?: string, + 'CodecID'?: string, + 'TrackType'?: string, + 'AudioChannels'?: number, + 'AudioSampleRate'?: number, + 'AudioBitsPerSample'?: number, + 'TagName'?: 'DURATION', + 'TagString'?: string, + 'ImageSize'?: string, + 'Megapixels'?: number, +} + +export interface ImediaInfo { + track?: [{ + '@type': string, + 'UniqueID': string, + 'VideoCount': string, + 'AudioCount': string, + 'Format': string, + 'Format_Version': string, + 'FileSize': string, + 'Duration': string, + 'OverallBitRate': string, + 'FrameRate': string, + 'FrameCount': string, + 'IsStreamable': string, + 'Encoded_Application': string, + 'Encoded_Library': string, + BitRate: number, + 'extra': { + 'ErrorDetectionType': string, + } + }], +} + +export interface IFileObjectMin { + _id: string, + file: string, + DB: string, + footprintId: string, +} + +type IbaseStatus = '' | 'Hold' | 'Queued' +export type IHealthCheck = IbaseStatus | 'Success' | 'Error' | 'Cancelled' +export type ITranscodeDecisionMaker = IbaseStatus | 'Transcode success' + | 'Transcode error' | 'Transcode cancelled' | 'Not required' + +export interface IFileObjectStripped extends IFileObjectMin { + container: string, + scannerReads: { + ffProbeRead: string, + } + createdAt: number, + lastPluginDetails: string, + bit_rate: number, + statSync: IstatSync, // tlint-disable-line statSync + file_size: number, + ffProbeData: IffProbeData, + hasClosedCaptions: boolean, + bumped: boolean, + HealthCheck: IHealthCheck, + TranscodeDecisionMaker: ITranscodeDecisionMaker, + holdUntil: number, + fileMedium: string, + video_codec_name: string, + audio_codec_name: string, + video_resolution: string, + + lastHealthCheckDate: number, + lastTranscodeDate: number, + history: string, + oldSize: number, + newSize: number, + videoStreamIndex: number; + // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-module-boundary-types + [index: string]: any, +} + +export interface IFileObject extends IFileObjectStripped { + scannerReads: { + ffProbeRead: string, + exiftoolRead: string, + mediaInfoRead: string, + closedCaptionRead: string, + } + meta?: Imeta, + mediaInfo?: ImediaInfo, + // eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-module-boundary-types + [index: string]: any, +} diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/synced/jobInterface.ts b/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/synced/jobInterface.ts new file mode 100644 index 0000000..c3e10fa --- /dev/null +++ b/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/synced/jobInterface.ts @@ -0,0 +1,10 @@ +interface Ijob { + version: string, + footprintId: string, + jobId: string, + start: number, + type: string, + fileId: string +} + +export default Ijob; diff --git a/examples/Tdarr_Plugin_a9he_New_file_size_check.js b/examples/Tdarr_Plugin_a9he_New_file_size_check.js index 7b1f1f9..b553171 100644 --- a/examples/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/examples/Tdarr_Plugin_a9he_New_file_size_check.js @@ -12,7 +12,7 @@ const details = () => ({ const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object at some point in the function else plugin will fail. const response = { diff --git a/examples/Tdarr_Plugin_f001_Filter_Example.js b/examples/Tdarr_Plugin_f001_Filter_Example.js index 400e1f6..d6be882 100644 --- a/examples/Tdarr_Plugin_f001_Filter_Example.js +++ b/examples/Tdarr_Plugin_f001_Filter_Example.js @@ -10,10 +10,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); // Must return this object at some point in the function else plugin will fail. diff --git a/examples/Tdarr_Plugin_f002_Filter_Example.js b/examples/Tdarr_Plugin_f002_Filter_Example.js index ab6077b..5a1961b 100644 --- a/examples/Tdarr_Plugin_f002_Filter_Example.js +++ b/examples/Tdarr_Plugin_f002_Filter_Example.js @@ -10,10 +10,10 @@ const details = () => ({ Inputs: [], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { processFile: true, diff --git a/examples/Tdarr_Plugin_pos1_Post_Proc_Example.js b/examples/Tdarr_Plugin_pos1_Post_Proc_Example.js index 7c19795..492fabc 100644 --- a/examples/Tdarr_Plugin_pos1_Post_Proc_Example.js +++ b/examples/Tdarr_Plugin_pos1_Post_Proc_Example.js @@ -44,13 +44,15 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); // load default plugin inputs + // eslint-disable-next-line @typescript-eslint/no-unused-vars inputs = lib.loadDefaultValues(inputs, details); // Only 'require' dependencies within this function or other functions. Do not require in the top scope. + // eslint-disable-next-line @typescript-eslint/no-unused-vars const importFresh = require('import-fresh'); console.log( diff --git a/examples/Tdarr_Plugin_pre1_Pre_Proc_Example.js b/examples/Tdarr_Plugin_pre1_Pre_Proc_Example.js index 51687ce..76efd68 100644 --- a/examples/Tdarr_Plugin_pre1_Pre_Proc_Example.js +++ b/examples/Tdarr_Plugin_pre1_Pre_Proc_Example.js @@ -69,13 +69,14 @@ const details = () => ({ ], }); -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); // load default plugin inputs inputs = lib.loadDefaultValues(inputs, details); // Only 'require' dependencies within this function or other functions. Do not require in the top scope. + // eslint-disable-next-line @typescript-eslint/no-unused-vars const importFresh = require('import-fresh'); // Must return following object at some point in the function else plugin will fail. diff --git a/methods/library/actions/transcodeStandardiseAudioCodecs.js b/methods/library/actions/transcodeStandardiseAudioCodecs.js index 012b8da..ef0646a 100644 --- a/methods/library/actions/transcodeStandardiseAudioCodecs.js +++ b/methods/library/actions/transcodeStandardiseAudioCodecs.js @@ -1,4 +1,4 @@ -module.exports = function transcodeStandardiseAudioCodecs(file, audioEncoder) { +module.exports = (file, audioEncoder) => { // Function required responses // preset // processFile diff --git a/methods/library/filters/filterByAge.js b/methods/library/filters/filterByAge.js index 176d9ff..bb37f12 100644 --- a/methods/library/filters/filterByAge.js +++ b/methods/library/filters/filterByAge.js @@ -1,4 +1,4 @@ -function filterByAge(file, ageCutOff_Seconds, type) { +const filterByAge = (file, ageCutOff_Seconds, type) => { try { const timeNow = new Date(); const dateCreated = new Date(file.statSync.birthtime); @@ -24,6 +24,6 @@ function filterByAge(file, ageCutOff_Seconds, type) { }; return response; } -} +}; module.exports = filterByAge; diff --git a/methods/library/filters/filterByBitrate.js b/methods/library/filters/filterByBitrate.js index a269b66..17e0797 100644 --- a/methods/library/filters/filterByBitrate.js +++ b/methods/library/filters/filterByBitrate.js @@ -1,4 +1,4 @@ -function filterByBitrate(file, lowerBound, upperBound) { +const filterByBitrate = (file, lowerBound, upperBound) => { try { if ( file.bit_rate >= lowerBound @@ -22,6 +22,6 @@ function filterByBitrate(file, lowerBound, upperBound) { }; return response; } -} +}; module.exports = filterByBitrate; diff --git a/methods/library/filters/filterByCodec.js b/methods/library/filters/filterByCodec.js index 3e6b1cc..a3ae7eb 100644 --- a/methods/library/filters/filterByCodec.js +++ b/methods/library/filters/filterByCodec.js @@ -1,4 +1,4 @@ -function filterByCodec(file, mode, codecs) { +const filterByCodec = (file, mode, codecs) => { try { // console.log(file,mode,codecs) @@ -54,6 +54,6 @@ function filterByCodec(file, mode, codecs) { }; return response; } -} +}; module.exports = filterByCodec; diff --git a/methods/library/filters/filterByMedium.js b/methods/library/filters/filterByMedium.js index 35703f1..05d457b 100644 --- a/methods/library/filters/filterByMedium.js +++ b/methods/library/filters/filterByMedium.js @@ -1,4 +1,4 @@ -function filterByMedium(file, medium) { +const filterByMedium = (file, medium) => { try { if (file.fileMedium !== medium) { const response = { @@ -19,6 +19,6 @@ function filterByMedium(file, medium) { }; return response; } -} +}; module.exports = filterByMedium; diff --git a/methods/library/filters/filterByResolution.js b/methods/library/filters/filterByResolution.js index a3a0cfc..c185529 100644 --- a/methods/library/filters/filterByResolution.js +++ b/methods/library/filters/filterByResolution.js @@ -1,4 +1,4 @@ -function filterByResolution(file, mode, resolution) { +const filterByResolution = (file, mode, resolution) => { try { if (mode === 'exclude') { if ( @@ -40,6 +40,6 @@ function filterByResolution(file, mode, resolution) { } throw new Error('Plugin error, no filter mode specified'); -} +}; module.exports = filterByResolution; diff --git a/methods/library/filters/filterBySize.js b/methods/library/filters/filterBySize.js index ebd35f0..b979b11 100644 --- a/methods/library/filters/filterBySize.js +++ b/methods/library/filters/filterBySize.js @@ -1,4 +1,4 @@ -function filterBySize(file, lowerBound, upperBound) { +const filterBySize = (file, lowerBound, upperBound) => { try { if ( file.file_size / 1000 >= lowerBound @@ -22,6 +22,6 @@ function filterBySize(file, lowerBound, upperBound) { }; return response; } -} +}; module.exports = filterBySize; diff --git a/methods/loadDefaultValues.js b/methods/loadDefaultValues.js index 94e92a2..b1fc07d 100644 --- a/methods/loadDefaultValues.js +++ b/methods/loadDefaultValues.js @@ -4,7 +4,9 @@ const loadDefaultValues = (inputs, details) => { if (!inputs) { inputs = {}; } - const defaultInputs = details().Inputs; + + const dets = details(); + const defaultInputs = dets.Inputs || dets.inputs || []; for (let i = 0; i < defaultInputs.length; i += 1) { if (typeof inputs[defaultInputs[i].name] === 'string') { inputs[defaultInputs[i].name] = inputs[defaultInputs[i].name].trim(); diff --git a/package-lock.json b/package-lock.json index 6643c53..878cd4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,73 +1,95 @@ { "name": "tdarr_plugins", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@babel/code-frame": { + "packages": { + "": { + "name": "tdarr_plugins", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "chalk": "^4.1.2", + "import-fresh": "^3.3.0", + "lodash": "^4.17.21" + }, + "devDependencies": { + "@types/node": "^20.5.1", + "@typescript-eslint/eslint-plugin": "^4.14.1", + "@typescript-eslint/parser": "^4.14.1", + "chai": "^4.3.6", + "eslint": "^7.14.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-prefer-arrow-functions": "^3.1.4" + } + }, + "node_modules/@babel/code-frame": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, - "requires": { + "dependencies": { "@babel/highlight": "^7.10.4" } }, - "@babel/helper-validator-identifier": { + "node_modules/@babel/helper-validator-identifier": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, - "@babel/highlight": { + "node_modules/@babel/highlight": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, - "requires": { + "dependencies": { "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", "js-tokens": "^4.0.0" - }, + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - } + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "@babel/runtime": { + "node_modules/@babel/runtime": { "version": "7.12.5", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", "dev": true, - "requires": { + "dependencies": { "regenerator-runtime": "^0.13.4" } }, - "@babel/runtime-corejs3": { + "node_modules/@babel/runtime-corejs3": { "version": "7.12.5", "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.12.5.tgz", "integrity": "sha512-roGr54CsTmNPPzZoCP1AmDXuBoNao7tnSA83TXTwt+UK5QVyh1DIJnrgYRPWKCF2flqZQXwa7Yr8v7VmLzF0YQ==", "dev": true, - "requires": { + "dependencies": { "core-js-pure": "^3.0.0", "regenerator-runtime": "^0.13.4" } }, - "@eslint/eslintrc": { + "node_modules/@eslint/eslintrc": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz", "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==", "dev": true, - "requires": { + "dependencies": { "ajv": "^6.12.4", "debug": "^4.1.1", "espree": "^7.3.0", @@ -78,169 +100,476 @@ "lodash": "^4.17.19", "minimatch": "^3.0.4", "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" } }, - "@types/json5": { + "node_modules/@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "dev": true + }, + "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, - "acorn": { + "node_modules/@types/node": { + "version": "20.5.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.1.tgz", + "integrity": "sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", + "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "4.33.0", + "@typescript-eslint/scope-manager": "4.33.0", + "debug": "^4.3.1", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^4.0.0", + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", + "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + } + }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", + "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", + "debug": "^4.3.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", + "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", + "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", + "dev": true, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", + "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0", + "debug": "^4.3.1", + "globby": "^11.0.3", + "is-glob": "^4.0.1", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", + "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.33.0", + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } }, - "acorn-jsx": { + "node_modules/acorn-jsx": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } }, - "ajv": { + "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "requires": { + "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "ansi-colors": { + "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true + "dev": true, + "engines": { + "node": ">=6" + } }, - "ansi-regex": { + "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + } }, - "ansi-styles": { + "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "requires": { + "dependencies": { "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "argparse": { + "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "requires": { + "dependencies": { "sprintf-js": "~1.0.2" } }, - "aria-query": { + "node_modules/aria-query": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-4.2.2.tgz", "integrity": "sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==", "dev": true, - "requires": { + "dependencies": { "@babel/runtime": "^7.10.2", "@babel/runtime-corejs3": "^7.10.2" + }, + "engines": { + "node": ">=6.0" } }, - "array-includes": { + "node_modules/array-includes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.2.tgz", "integrity": "sha512-w2GspexNQpx+PutG3QpT437/BenZBj0M/MZGn5mzv/MofYqo0xmRHzn4lFsoDlWJ+THYsGJmFlW68WlDFx7VRw==", "dev": true, - "requires": { + "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.1", "get-intrinsic": "^1.0.1", "is-string": "^1.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "array.prototype.flat": { + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flat": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", "dev": true, - "requires": { + "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "assertion-error": { + "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true + "dev": true, + "engines": { + "node": "*" + } }, - "ast-types-flow": { + "node_modules/ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", "dev": true }, - "astral-regex": { + "node_modules/astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "axe-core": { + "node_modules/axe-core": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.1.1.tgz", "integrity": "sha512-5Kgy8Cz6LPC9DJcNb3yjAXTu3XihQgEdnIg50c//zOC/MyLP0Clg+Y8Sh9ZjjnvBrDZU4DgXS9C3T9r4/scGZQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "axobject-query": { + "node_modules/axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", "integrity": "sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==", "dev": true }, - "balanced-match": { + "node_modules/balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "brace-expansion": { + "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "requires": { + "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "call-bind": { + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", "dev": true, - "requires": { + "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "callsites": { + "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "engines": { + "node": ">=6" + } }, - "chai": { + "node_modules/chai": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", "dev": true, - "requires": { + "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", "deep-eql": "^3.0.1", @@ -248,187 +577,265 @@ "loupe": "^2.3.1", "pathval": "^1.1.1", "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" } }, - "chalk": { + "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { + "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "check-error": { + "node_modules/chalk/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/chalk/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/chalk/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", - "dev": true + "dev": true, + "engines": { + "node": "*" + } }, - "color-convert": { + "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "requires": { + "dependencies": { "color-name": "1.1.3" } }, - "color-name": { + "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "confusing-browser-globals": { + "node_modules/confusing-browser-globals": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz", "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==", "dev": true }, - "contains-path": { + "node_modules/contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "core-js-pure": { + "node_modules/core-js-pure": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.8.1.tgz", "integrity": "sha512-Se+LaxqXlVXGvmexKGPvnUIYC1jwXu1H6Pkyb3uBM5d8/NELMYCHs/4/roD7721NxrTLyv7e5nXd5/QLBO+10g==", - "dev": true + "deprecated": "core-js-pure@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js-pure.", + "dev": true, + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } }, - "cross-spawn": { + "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, - "requires": { + "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, - "damerau-levenshtein": { + "node_modules/damerau-levenshtein": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz", "integrity": "sha512-JVrozIeElnj3QzfUIt8tB8YMluBJom4Vw9qTPpjGYQ9fYlB3D/rb6OordUxf3xeFB35LKWs0xqcO5U6ySvBtug==", "dev": true }, - "debug": { + "node_modules/debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, - "requires": { + "dependencies": { "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "deep-eql": { + "node_modules/deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "dev": true, - "requires": { + "dependencies": { "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" } }, - "deep-is": { + "node_modules/deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "define-properties": { + "node_modules/define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, - "requires": { + "dependencies": { "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" } }, - "doctrine": { + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, - "requires": { + "dependencies": { "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" } }, - "emoji-regex": { + "node_modules/emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "enquirer": { + "node_modules/enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", "dev": true, - "requires": { + "dependencies": { "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" } }, - "error-ex": { + "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "requires": { + "dependencies": { "is-arrayish": "^0.2.1" } }, - "es-abstract": { + "node_modules/es-abstract": { "version": "1.18.0-next.1", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", "dev": true, - "requires": { + "dependencies": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", @@ -441,31 +848,46 @@ "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "es-to-primitive": { + "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, - "requires": { + "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "escape-string-regexp": { + "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.8.0" + } }, - "eslint": { + "node_modules/eslint": { "version": "7.15.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.15.0.tgz", "integrity": "sha512-Vr64xFDT8w30wFll643e7cGrIkPEU50yIiI36OdSIDoSGguIeaLzBo0vpGvzo9RECUqq7htURfwEtKqwytkqzA==", "dev": true, - "requires": { + "dependencies": { "@babel/code-frame": "^7.0.0", "@eslint/eslintrc": "^0.2.2", "ajv": "^6.10.0", @@ -504,129 +926,93 @@ "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "eslint-config-airbnb-base": { + "node_modules/eslint-config-airbnb-base": { "version": "14.2.1", "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", "dev": true, - "requires": { + "dependencies": { "confusing-browser-globals": "^1.0.10", "object.assign": "^4.1.2", "object.entries": "^1.1.2" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "eslint": "^5.16.0 || ^6.8.0 || ^7.2.0", + "eslint-plugin-import": "^2.22.1" } }, - "eslint-import-resolver-node": { + "node_modules/eslint-import-resolver-node": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", "dev": true, - "requires": { + "dependencies": { "debug": "^2.6.9", "resolve": "^1.13.1" - }, + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "ms": "2.0.0" } }, - "eslint-module-utils": { + "node_modules/eslint-import-resolver-node/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-module-utils": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", "dev": true, - "requires": { + "dependencies": { "debug": "^2.6.9", "pkg-dir": "^2.0.0" }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "ms": "2.0.0" } }, - "eslint-plugin-import": { + "node_modules/eslint-module-utils/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-plugin-import": { "version": "2.22.1", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", "dev": true, - "requires": { + "dependencies": { "array-includes": "^3.1.1", "array.prototype.flat": "^1.2.3", "contains-path": "^0.1.0", @@ -641,40 +1027,47 @@ "resolve": "^1.17.0", "tsconfig-paths": "^3.9.0" }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "doctrine": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", - "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "isarray": "^1.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "ms": "2.0.0" } }, - "eslint-plugin-jsx-a11y": { + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "dependencies": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/eslint-plugin-jsx-a11y": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz", "integrity": "sha512-0rGPJBbwHoGNPU73/QCLP/vveMlM1b1Z9PponxO87jfr6tuH5ligXbDT6nHSSzBC8ovX2Z+BQu7Bk5D/Xgq9zg==", "dev": true, - "requires": { + "dependencies": { "@babel/runtime": "^7.11.2", "aria-query": "^4.2.2", "array-includes": "^3.1.1", @@ -687,1052 +1080,1675 @@ "jsx-ast-utils": "^3.1.0", "language-tags": "^1.0.5" }, - "dependencies": { - "emoji-regex": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.0.tgz", - "integrity": "sha512-DNc3KFPK18bPdElMJnf/Pkv5TXhxFU3YFDEuGLDRtPmV4rkmCjBkCSEp22u6rBHdSN9Vlp/GK7k98prmE1Jgug==", - "dev": true - } + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7" } }, - "eslint-scope": { + "node_modules/eslint-plugin-jsx-a11y/node_modules/emoji-regex": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.0.tgz", + "integrity": "sha512-DNc3KFPK18bPdElMJnf/Pkv5TXhxFU3YFDEuGLDRtPmV4rkmCjBkCSEp22u6rBHdSN9Vlp/GK7k98prmE1Jgug==", + "dev": true + }, + "node_modules/eslint-plugin-prefer-arrow-functions": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow-functions/-/eslint-plugin-prefer-arrow-functions-3.1.4.tgz", + "integrity": "sha512-LSO8VibqBKqzelr+L21mEIfachavCon+1SEumCJ6U8Ze2q0pntyojmomcVwd9RZBjrP+HV6k1Osz0B3Xwdq8WA==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, + "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, - "requires": { + "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" } }, - "eslint-utils": { + "node_modules/eslint-utils": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, - "requires": { + "dependencies": { "eslint-visitor-keys": "^1.1.0" }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" } }, - "eslint-visitor-keys": { + "node_modules/eslint-visitor-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "espree": { + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, - "requires": { + "dependencies": { "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", "eslint-visitor-keys": "^1.3.0" }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" } }, - "esprima": { + "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } }, - "esquery": { + "node_modules/esquery": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, - "requires": { + "dependencies": { "estraverse": "^5.1.0" }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" } }, - "esrecurse": { + "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "requires": { + "dependencies": { "estraverse": "^5.2.0" }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" } }, - "estraverse": { + "node_modules/estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true + "dev": true, + "engines": { + "node": ">=4.0" + } }, - "esutils": { + "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "fast-deep-equal": { + "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "fast-json-stable-stringify": { + "node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "fast-levenshtein": { + "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "file-entry-cache": { + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", "dev": true, - "requires": { + "dependencies": { "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "find-up": { + "node_modules/find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, - "requires": { + "dependencies": { "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "flat-cache": { + "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, - "requires": { + "dependencies": { "flatted": "^3.1.0", "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" } }, - "flatted": { + "node_modules/flatted": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz", "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==", "dev": true }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "function-bind": { + "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "functional-red-black-tree": { + "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "get-func-name": { + "node_modules/get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true + "dev": true, + "engines": { + "node": "*" + } }, - "get-intrinsic": { + "node_modules/get-intrinsic": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", "dev": true, - "requires": { + "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "glob": { + "node_modules/glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, - "requires": { + "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "glob-parent": { + "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "requires": { + "dependencies": { "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" } }, - "globals": { + "node_modules/globals": { "version": "12.4.0", "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, - "requires": { + "dependencies": { "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" } }, - "graceful-fs": { + "node_modules/graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, - "has": { + "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, - "requires": { + "dependencies": { "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" } }, - "has-flag": { + "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "has-symbols": { + "node_modules/has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "hosted-git-info": { + "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, - "ignore": { + "node_modules/ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "dev": true, + "engines": { + "node": ">= 4" + } }, - "import-fresh": { + "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "requires": { + "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "imurmurhash": { + "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.8.19" + } }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, - "requires": { + "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "is-arrayish": { + "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-callable": { + "node_modules/is-callable": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "is-core-module": { + "node_modules/is-core-module": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", "dev": true, - "requires": { + "dependencies": { "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "is-date-object": { + "node_modules/is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "is-extglob": { + "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "is-fullwidth-code-point": { + "node_modules/is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "is-glob": { + "node_modules/is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, - "requires": { + "dependencies": { "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-negative-zero": { + "node_modules/is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } }, - "is-regex": { + "node_modules/is-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "dev": true, - "requires": { + "dependencies": { "has-symbols": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "is-string": { + "node_modules/is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "is-symbol": { + "node_modules/is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "dev": true, - "requires": { + "dependencies": { "has-symbols": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "isarray": { + "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, - "isexe": { + "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "js-tokens": { + "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "js-yaml": { + "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, - "requires": { + "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "json-schema-traverse": { + "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "json-stable-stringify-without-jsonify": { + "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json5": { + "node_modules/json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, - "requires": { + "dependencies": { "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" } }, - "jsx-ast-utils": { + "node_modules/jsx-ast-utils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.1.0.tgz", "integrity": "sha512-d4/UOjg+mxAWxCiF0c5UTSwyqbchkbqCvK87aBovhnh8GtysTjWmgC63tY0cJx/HzGgm9qnA147jVBdpOiQ2RA==", "dev": true, - "requires": { + "dependencies": { "array-includes": "^3.1.1", "object.assign": "^4.1.1" + }, + "engines": { + "node": ">=4.0" } }, - "language-subtag-registry": { + "node_modules/language-subtag-registry": { "version": "0.3.21", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz", "integrity": "sha512-L0IqwlIXjilBVVYKFT37X9Ih11Um5NEl9cbJIuU/SwP/zEEAbBPOnEeeuxVMf45ydWQRDQN3Nqc96OgbH1K+Pg==", "dev": true }, - "language-tags": { + "node_modules/language-tags": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", "integrity": "sha1-0yHbxNowuovzAk4ED6XBRmH5GTo=", "dev": true, - "requires": { + "dependencies": { "language-subtag-registry": "~0.3.2" } }, - "levn": { + "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, - "requires": { + "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "load-json-file": { + "node_modules/load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, - "requires": { + "dependencies": { "graceful-fs": "^4.1.2", "parse-json": "^2.2.0", "pify": "^2.0.0", "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "locate-path": { + "node_modules/locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, - "requires": { + "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "lodash": { + "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "loupe": { + "node_modules/loupe": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", "dev": true, - "requires": { + "dependencies": { "get-func-name": "^2.0.0" } }, - "lru-cache": { + "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, - "requires": { + "dependencies": { "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" } }, - "minimatch": { + "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, - "requires": { + "dependencies": { "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "minimist": { + "node_modules/minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, - "ms": { + "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "natural-compare": { + "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "normalize-package-data": { + "node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, - "requires": { + "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } } }, - "object-inspect": { + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/object-inspect": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", - "dev": true + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "object-keys": { + "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.4" + } }, - "object.assign": { + "node_modules/object.assign": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, - "requires": { + "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", "has-symbols": "^1.0.1", "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "object.entries": { + "node_modules/object.entries": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz", "integrity": "sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==", "dev": true, - "requires": { + "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.1", "has": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" } }, - "object.values": { + "node_modules/object.values": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", "dev": true, - "requires": { + "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.1", "has": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "once": { + "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "requires": { + "dependencies": { "wrappy": "1" } }, - "optionator": { + "node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, - "requires": { + "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" } }, - "p-limit": { + "node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, - "requires": { + "dependencies": { "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" } }, - "p-locate": { + "node_modules/p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, - "requires": { + "dependencies": { "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" } }, - "p-try": { + "node_modules/p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "parent-module": { + "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "requires": { + "dependencies": { "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, - "parse-json": { + "node_modules/parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, - "requires": { + "dependencies": { "error-ex": "^1.2.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "path-exists": { + "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "path-is-absolute": { + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "path-key": { + "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + } }, - "path-parse": { + "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "path-type": { + "node_modules/path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, - "requires": { + "dependencies": { "pify": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "pathval": { + "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } }, - "pify": { + "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "pkg-dir": { + "node_modules/pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, - "requires": { + "dependencies": { "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" } }, - "prelude-ls": { + "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true + "dev": true, + "engines": { + "node": ">= 0.8.0" + } }, - "progress": { + "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.4.0" + } }, - "punycode": { + "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "read-pkg": { + "node_modules/read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, - "requires": { + "dependencies": { "load-json-file": "^2.0.0", "normalize-package-data": "^2.3.2", "path-type": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "read-pkg-up": { + "node_modules/read-pkg-up": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, - "requires": { + "dependencies": { "find-up": "^2.0.0", "read-pkg": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "regenerator-runtime": { + "node_modules/regenerator-runtime": { "version": "0.13.7", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", "dev": true }, - "regexpp": { + "node_modules/regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } }, - "resolve": { + "node_modules/resolve": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", "dev": true, - "requires": { + "dependencies": { "is-core-module": "^2.1.0", "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "resolve-from": { + "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "engines": { + "node": ">=4" + } }, - "rimraf": { + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, - "requires": { + "dependencies": { "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" } }, - "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, - "requires": { + "dependencies": { "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "shebang-command": { + "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, - "requires": { + "dependencies": { "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "shebang-regex": { + "node_modules/shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "slice-ansi": { + "node_modules/slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, - "requires": { + "dependencies": { "ansi-styles": "^3.2.0", "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" } }, - "spdx-correct": { + "node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, - "requires": { + "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, - "spdx-exceptions": { + "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, - "spdx-expression-parse": { + "node_modules/spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, - "requires": { + "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, - "spdx-license-ids": { + "node_modules/spdx-license-ids": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", "dev": true }, - "sprintf-js": { + "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "string-width": { + "node_modules/string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, - "requires": { + "dependencies": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^5.1.0" }, + "engines": { + "node": ">=6" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, "dependencies": { - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" } }, - "string.prototype.trimend": { + "node_modules/string.prototype.trimend": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", "dev": true, - "requires": { + "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "string.prototype.trimstart": { + "node_modules/string.prototype.trimstart": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", "dev": true, - "requires": { + "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "strip-ansi": { + "node_modules/strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, - "requires": { + "dependencies": { "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" } }, - "strip-bom": { + "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "strip-json-comments": { + "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "supports-color": { + "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, - "requires": { + "dependencies": { "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "table": { + "node_modules/table": { "version": "5.4.6", "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, - "requires": { + "dependencies": { "ajv": "^6.10.2", "lodash": "^4.17.14", "slice-ansi": "^2.1.0", "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" } }, - "text-table": { + "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "tsconfig-paths": { + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", "dev": true, - "requires": { + "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.1", "minimist": "^1.2.0", "strip-bom": "^3.0.0" } }, - "type-check": { + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, - "requires": { + "dependencies": { "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" } }, - "type-detect": { + "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "type-fest": { + "node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } }, - "uri-js": { + "node_modules/uri-js": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "dev": true, - "requires": { + "dependencies": { "punycode": "^2.1.0" } }, - "v8-compile-cache": { + "node_modules/v8-compile-cache": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, - "validate-npm-package-license": { + "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, - "requires": { + "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, - "which": { + "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "requires": { + "dependencies": { "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, - "word-wrap": { + "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "wrappy": { + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "yallist": { + "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", diff --git a/package.json b/package.json index 7897352..5d50a60 100644 --- a/package.json +++ b/package.json @@ -9,16 +9,20 @@ "lodash": "^4.17.21" }, "devDependencies": { + "@types/node": "^20.5.1", + "@typescript-eslint/eslint-plugin": "^4.14.1", + "@typescript-eslint/parser": "^4.14.1", "chai": "^4.3.6", "eslint": "^7.14.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsx-a11y": "^6.4.1" + "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-prefer-arrow-functions": "^3.1.4" }, "scripts": { "test": "node ./tests/runTests.js", - "lint": "eslint Community methods examples tests --ext js", - "lint:fix": "eslint Community methods examples tests --ext js --fix", + "lint": "eslint FlowPluginsTs Community methods examples tests --ext js,ts", + "lint:fix": "eslint FlowPluginsTs Community methods examples tests --ext js,ts --fix", "checkPlugins": "node ./tests/checkPlugins.js" }, "repository": { diff --git a/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js index 3976913..a096bc4 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js +++ b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js @@ -89,4 +89,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js index 5777e28..1bbb25b 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js +++ b/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js @@ -71,4 +71,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js index 6be2efd..b4105a4 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js +++ b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -63,4 +63,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js index 26d68f4..a72546b 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js +++ b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js @@ -86,4 +86,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index 96ca95f..2ed4b36 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -157,4 +157,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_remove_audio_by_channel_count.js b/tests/Community/Tdarr_Plugin_00td_action_remove_audio_by_channel_count.js index d304813..da0ff4a 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_remove_audio_by_channel_count.js +++ b/tests/Community/Tdarr_Plugin_00td_action_remove_audio_by_channel_count.js @@ -103,4 +103,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js b/tests/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js index ca950c1..1457d04 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js +++ b/tests/Community/Tdarr_Plugin_00td_action_remove_stream_by_specified_property.js @@ -219,4 +219,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_remux_container.js b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js index 985688b..8e1cc6a 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_remux_container.js +++ b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js @@ -62,4 +62,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js b/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js index 63e1505..a975217 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js +++ b/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js @@ -63,4 +63,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_transcode.js b/tests/Community/Tdarr_Plugin_00td_action_transcode.js index 5055986..d02649a 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_transcode.js +++ b/tests/Community/Tdarr_Plugin_00td_action_transcode.js @@ -139,4 +139,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_bit_depth.js b/tests/Community/Tdarr_Plugin_00td_filter_bit_depth.js index c3a2bd3..97d43ec 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_bit_depth.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_bit_depth.js @@ -239,4 +239,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_break_stack_if_processed.js b/tests/Community/Tdarr_Plugin_00td_filter_break_stack_if_processed.js index 0d59019..4c048a3 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_break_stack_if_processed.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_break_stack_if_processed.js @@ -37,4 +37,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js index 4c22116..0ac71d7 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js @@ -61,4 +61,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js b/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js index e8e6cd3..f0475d7 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js @@ -56,4 +56,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js b/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js index 4616650..e8a9e07 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js @@ -56,4 +56,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_file_property.js b/tests/Community/Tdarr_Plugin_00td_filter_by_file_property.js index 9d318d6..7e2cdb7 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_file_property.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_file_property.js @@ -532,4 +532,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js b/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js index 91cc03f..b4148fb 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js @@ -71,4 +71,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_size.js b/tests/Community/Tdarr_Plugin_00td_filter_by_size.js index a869c4c..cdc4016 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_size.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_size.js @@ -61,4 +61,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js b/tests/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js index 48e1c99..3c6de52 100644 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_stream_tag.js @@ -232,4 +232,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js b/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js index 9365ddf..3daa608 100644 --- a/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js +++ b/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js @@ -38,4 +38,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js b/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js index c6627a6..8ed713d 100644 --- a/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js +++ b/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js @@ -78,4 +78,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js b/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js index d6dc22c..265d309 100644 --- a/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js +++ b/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js @@ -38,4 +38,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js b/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js index 88633af..17d5c70 100644 --- a/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js +++ b/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js @@ -38,4 +38,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js b/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js index 0d7ee54..74ea621 100644 --- a/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js +++ b/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js @@ -38,4 +38,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js b/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js index 2f226dc..2317441 100644 --- a/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js +++ b/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js @@ -87,4 +87,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js b/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js index cc9ef73..ba34062 100644 --- a/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js +++ b/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js @@ -59,4 +59,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js b/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js index 9a3053c..ad69112 100644 --- a/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js +++ b/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js @@ -41,4 +41,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js b/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js index 780bf5d..a910d12 100644 --- a/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js +++ b/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js @@ -109,4 +109,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js b/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js index 6557f17..21fc74a 100644 --- a/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js +++ b/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js @@ -72,4 +72,4 @@ const tests = [ ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index 93e847c..00e78dd 100644 --- a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -136,4 +136,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js index ef5221c..c7318b2 100644 --- a/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js +++ b/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js @@ -56,4 +56,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js index 4ef125b..7f75c2d 100644 --- a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -170,4 +170,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js index 590723b..077e811 100644 --- a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -170,4 +170,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js index 16051f0..74b062c 100644 --- a/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -42,4 +42,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js b/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js index 5208106..424e114 100644 --- a/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js +++ b/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js @@ -43,4 +43,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js index 11bd864..ad1cad4 100644 --- a/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js +++ b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -95,4 +95,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js b/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js index fa10ac5..a9d0d98 100644 --- a/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js +++ b/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js @@ -69,4 +69,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js index b8b4a14..8477990 100644 --- a/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js +++ b/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js @@ -239,4 +239,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js b/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js index d4a111a..82545e7 100644 --- a/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js +++ b/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js @@ -100,4 +100,4 @@ const tests = [ ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js index bdb0c02..828317e 100644 --- a/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js +++ b/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js @@ -43,4 +43,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js b/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js index 40adead..b9dd8b5 100644 --- a/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js +++ b/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js @@ -44,4 +44,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js b/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js index 1c5438d..4226191 100644 --- a/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js +++ b/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js @@ -104,4 +104,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js b/tests/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js index ba27529..65d50ad 100644 --- a/tests/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js +++ b/tests/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js @@ -134,4 +134,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/tests/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js index 228ff5c..f7a5a31 100644 --- a/tests/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js +++ b/tests/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -502,4 +502,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js index 22d571d..1d1c2ba 100644 --- a/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js +++ b/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js @@ -39,4 +39,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js index 805c984..1ead8be 100644 --- a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js +++ b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js @@ -63,4 +63,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js index 47cc98c..fd72aaf 100644 --- a/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js +++ b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js @@ -63,4 +63,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js b/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js index 4bf0913..8d77820 100644 --- a/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js +++ b/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js @@ -42,4 +42,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js index e990b36..7d69ab9 100644 --- a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -65,4 +65,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js b/tests/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js index 9497714..df8ed5d 100644 --- a/tests/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js +++ b/tests/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js @@ -65,4 +65,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js b/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js index 9c01863..37b777a 100644 --- a/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js +++ b/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js @@ -42,4 +42,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js b/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js index a3b9e80..acffef5 100644 --- a/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js +++ b/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js @@ -56,4 +56,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index 2b3d21a..78a7dbd 100644 --- a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -161,4 +161,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js index 1c012bf..0785865 100644 --- a/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js +++ b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js @@ -46,4 +46,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js b/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js index 455b2ca..7120465 100644 --- a/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js +++ b/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js @@ -47,4 +47,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js b/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js index c80b3dc..5052f58 100644 --- a/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js +++ b/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js @@ -44,4 +44,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js index e382ca8..44ed8c9 100644 --- a/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js +++ b/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js @@ -59,4 +59,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js index 2a46f53..d5b59ac 100644 --- a/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ b/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -106,4 +106,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js index edbb610..a2b6cf8 100644 --- a/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js +++ b/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js @@ -94,4 +94,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js index 4371d6c..dfdda5a 100644 --- a/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js +++ b/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js @@ -96,4 +96,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js index 046e210..049e3be 100644 --- a/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js +++ b/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js @@ -93,4 +93,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js b/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js index 5a70598..9891391 100644 --- a/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js +++ b/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js @@ -91,4 +91,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_f4k1_aune_audio_to_flac.js b/tests/Community/Tdarr_Plugin_f4k1_aune_audio_to_flac.js index 20ef026..9f95039 100644 --- a/tests/Community/Tdarr_Plugin_f4k1_aune_audio_to_flac.js +++ b/tests/Community/Tdarr_Plugin_f4k1_aune_audio_to_flac.js @@ -82,4 +82,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js b/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js index 86bb3c1..bc5016b 100644 --- a/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js +++ b/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js @@ -45,4 +45,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js b/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js index 71c8098..4f0d948 100644 --- a/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js +++ b/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js @@ -82,4 +82,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js b/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js index 894d3a0..8a4eb66 100644 --- a/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js +++ b/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js @@ -65,4 +65,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js b/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js index df39e53..bb567e6 100644 --- a/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js +++ b/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js @@ -63,4 +63,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js index 229b051..f40e36b 100644 --- a/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js +++ b/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js @@ -39,4 +39,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js index 197cc39..c196ad3 100644 --- a/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js +++ b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js @@ -47,4 +47,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js index 9dfabae..d7efca8 100644 --- a/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js +++ b/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js @@ -39,4 +39,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js b/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js index 4acaaaf..c920111 100644 --- a/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js +++ b/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js @@ -41,4 +41,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js b/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js index 3cdab96..cc069a3 100644 --- a/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js +++ b/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js @@ -64,4 +64,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js b/tests/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js index a6aa2ff..e3d5c51 100644 --- a/tests/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js +++ b/tests/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js @@ -81,4 +81,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js index 36ea9c2..6277e95 100644 --- a/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js +++ b/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -60,4 +60,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js index 6fad6fc..ae60e65 100644 --- a/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js +++ b/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -60,4 +60,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js b/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js index e81f664..f33b50b 100644 --- a/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js +++ b/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js @@ -60,4 +60,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js b/tests/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js index 0cbc716..4d3cbad 100644 --- a/tests/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js +++ b/tests/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js @@ -45,4 +45,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js b/tests/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js index 10424ec..5fca337 100644 --- a/tests/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js +++ b/tests/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js @@ -60,4 +60,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_tsld_filter_modified_date.js b/tests/Community/Tdarr_Plugin_tsld_filter_modified_date.js index f6b10e6..1a5ad0c 100644 --- a/tests/Community/Tdarr_Plugin_tsld_filter_modified_date.js +++ b/tests/Community/Tdarr_Plugin_tsld_filter_modified_date.js @@ -60,4 +60,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/tests/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 74a9319..bed03fd 100644 --- a/tests/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/tests/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -43,4 +43,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/tests/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index a916de0..b7141b3 100644 --- a/tests/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/tests/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -241,4 +241,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js b/tests/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js index fa423cf..fe9288e 100644 --- a/tests/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js +++ b/tests/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js @@ -167,4 +167,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_x7ab_Remove_Subs.js b/tests/Community/Tdarr_Plugin_x7ab_Remove_Subs.js index 9eca971..4dad399 100644 --- a/tests/Community/Tdarr_Plugin_x7ab_Remove_Subs.js +++ b/tests/Community/Tdarr_Plugin_x7ab_Remove_Subs.js @@ -39,4 +39,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js index 01df48b..49315df 100644 --- a/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js +++ b/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -64,4 +64,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 7f04b00..ce62896 100644 --- a/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -108,4 +108,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/tests/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index 56e03e7..d498daf 100644 --- a/tests/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/tests/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -108,4 +108,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/tests/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index 3d37593..56bb212 100644 --- a/tests/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/tests/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -108,4 +108,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/tests/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index 8216fb3..a557ccc 100644 --- a/tests/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/tests/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -108,4 +108,4 @@ const tests = [ }, ]; -run(tests); +void run(tests); diff --git a/tests/runTests.js b/tests/runTests.js index c96915d..971cc24 100644 --- a/tests/runTests.js +++ b/tests/runTests.js @@ -7,7 +7,7 @@ const childProcess = require('child_process'); const filenames = fs.readdirSync(`${process.cwd()}/Community`).reverse(); const errorsEncountered = []; -const run = async () => { +const run = () => { const pluginsToRun = []; for (let i = 0; i < filenames.length; i += 1) { const filename = filenames[i]; @@ -74,4 +74,4 @@ const run = async () => { } }; -run(); +void run(); diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 0000000..7ad9585 --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": [] +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..88285c4 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,67 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./FlowPlugins", /* Redirect output structure to the directory. */ + "rootDir": "./FlowPluginsTs", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + /* Strict Type-Checking Options */ + "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + /* Advanced Options */ + "skipLibCheck": true, /* Skip type checking of declaration files. */ + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + }, + "file": [ + "./node_modules/@types/express/index.d.ts" + ], + "exclude": [] +} \ No newline at end of file