Skip to content

Commit

Permalink
Merge branch 'ext_fix' of https://github.com/HaveAGitGat/Tdarr_Plugins
Browse files Browse the repository at this point in the history
…into ext_fix
  • Loading branch information
HaveAGitGat committed May 6, 2024
2 parents 6166203 + 97e92c8 commit 361f5d0
Show file tree
Hide file tree
Showing 5 changed files with 610 additions and 630 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ var plugin = function (args) {
// 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 extensionArray = extensions.trim().split(',').map(function (row) { return row.toLowerCase(); });
var extension = (0, fileUtils_1.getContainer)(args.inputFileObj._id).toLowerCase();
var extensionMatch = false;
if (extensionArray.includes(extension)) {
extensionMatch = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,33 +150,31 @@ var details = function () { return ({
],
}); };
exports.details = details;
var doOperation = function (_a) {
var args = _a.args, sourcePath = _a.sourcePath, destinationPath = _a.destinationPath, operation = _a.operation;
return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
args.jobLog("Input path: ".concat(sourcePath));
args.jobLog("Output path: ".concat(destinationPath));
if (!(sourcePath === destinationPath)) return [3 /*break*/, 1];
args.jobLog("Input and output path are the same, skipping ".concat(operation));
return [3 /*break*/, 3];
case 1:
args.deps.fsextra.ensureDirSync((0, fileUtils_1.getFileAbosluteDir)(destinationPath));
return [4 /*yield*/, (0, fileMoveOrCopy_1.default)({
operation: operation,
sourcePath: sourcePath,
destinationPath: destinationPath,
args: args,
})];
case 2:
_b.sent();
_b.label = 3;
case 3: return [2 /*return*/];
}
});
var doOperation = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
var args = _b.args, sourcePath = _b.sourcePath, destinationPath = _b.destinationPath, operation = _b.operation;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
args.jobLog("Input path: ".concat(sourcePath));
args.jobLog("Output path: ".concat(destinationPath));
if (!(sourcePath === destinationPath)) return [3 /*break*/, 1];
args.jobLog("Input and output path are the same, skipping ".concat(operation));
return [3 /*break*/, 3];
case 1:
args.deps.fsextra.ensureDirSync((0, fileUtils_1.getFileAbosluteDir)(destinationPath));
return [4 /*yield*/, (0, fileMoveOrCopy_1.default)({
operation: operation,
sourcePath: sourcePath,
destinationPath: destinationPath,
args: args,
})];
case 2:
_c.sent();
_c.label = 3;
case 3: return [2 /*return*/];
}
});
};
}); };
// eslint-disable-next-line @typescript-eslint/no-unused-vars
var plugin = function (args) { return __awaiter(void 0, void 0, void 0, function () {
var lib, _a, keepRelativePath, allFiles, sourceDirectory, outputDirectory, copyOrMove, fileExtensions, outputPath, subStem, sourceDir, filesInDir, i;
Expand Down
Loading

0 comments on commit 361f5d0

Please sign in to comment.