From 24466ecabb62fc64d93c67c0c41c4589716ace33 Mon Sep 17 00:00:00 2001 From: "jeanchristophe.mqt@gmail.com" Date: Sat, 11 Jan 2025 16:26:54 +0100 Subject: [PATCH] Made file path building system agnostic --- .../tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.js | 3 ++- .../tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/FlowPlugins/CommunityFlowPlugins/tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.js b/FlowPlugins/CommunityFlowPlugins/tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.js index a356aa7b9..f0272e54f 100644 --- a/FlowPlugins/CommunityFlowPlugins/tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.js +++ b/FlowPlugins/CommunityFlowPlugins/tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.js @@ -51,6 +51,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.plugin = exports.details = void 0; +var path_1 = __importDefault(require("path")); var fileMoveOrCopy_1 = __importDefault(require("../../../../FlowHelpers/1.0.0/fileMoveOrCopy")); var fileUtils_1 = require("../../../../FlowHelpers/1.0.0/fileUtils"); var details = function () { return ({ @@ -139,7 +140,7 @@ var buildNewPath = function (currentFileName, fileToRename) { var directory = (0, fileUtils_1.getFileAbosluteDir)(currentFileName); var fileName = (0, fileUtils_1.getFileName)(fileToRename.newPath); var container = (0, fileUtils_1.getContainer)(fileToRename.newPath); - return "".concat(directory, "/").concat(fileName, ".").concat(container); + return path_1.default.join(directory, fileName, container); }; var previewRename = function (args, host, headers, fileInfo, config) { return __awaiter(void 0, void 0, void 0, function () { var response, error_1; diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.ts index f5d7a343c..dda3581f5 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/applyRadarrOrSonarrNamingPolicy/2.0.0/index.ts @@ -1,3 +1,4 @@ +import path from 'path'; import fileMoveOrCopy from '../../../../FlowHelpers/1.0.0/fileMoveOrCopy'; import { getContainer, @@ -127,7 +128,7 @@ const buildNewPath = (currentFileName: string, fileToRename: IFileToRename): str const directory = getFileAbosluteDir(currentFileName); const fileName = getFileName(fileToRename.newPath); const container = getContainer(fileToRename.newPath); - return `${directory}/${fileName}.${container}`; + return path.join(directory, fileName, container); }; const previewRename = async (