mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-13 09:20:27 -07:00
Update file operation plugins
This commit is contained in:
parent
579aab99e9
commit
80f02bf810
22 changed files with 692 additions and 47 deletions
|
|
@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.moveFileAndValidate = exports.getSubStem = exports.getFfType = exports.getFileName = exports.getContainer = void 0;
|
||||
exports.getPluginWorkDir = exports.moveFileAndValidate = exports.getSubStem = exports.getFfType = exports.getFileAbosluteDir = exports.getFileName = exports.getContainer = void 0;
|
||||
var fs_1 = require("fs");
|
||||
var getContainer = function (filePath) {
|
||||
var parts = filePath.split('.');
|
||||
|
|
@ -51,6 +51,12 @@ var getFileName = function (filePath) {
|
|||
return parts2.join('.');
|
||||
};
|
||||
exports.getFileName = getFileName;
|
||||
var getFileAbosluteDir = function (filePath) {
|
||||
var parts = filePath.split('/');
|
||||
parts.pop();
|
||||
return parts.join('/');
|
||||
};
|
||||
exports.getFileAbosluteDir = getFileAbosluteDir;
|
||||
var getFfType = function (codecType) { return (codecType === 'video' ? 'v' : 'a'); };
|
||||
exports.getFfType = getFfType;
|
||||
var getSubStem = function (_a) {
|
||||
|
|
@ -140,3 +146,9 @@ var moveFileAndValidate = function (_a) {
|
|||
});
|
||||
};
|
||||
exports.moveFileAndValidate = moveFileAndValidate;
|
||||
var getPluginWorkDir = function (args) {
|
||||
var pluginWorkDir = "".concat(args.workDir, "/").concat(new Date().getTime());
|
||||
args.deps.fsextra.ensureDirSync(pluginWorkDir);
|
||||
return pluginWorkDir;
|
||||
};
|
||||
exports.getPluginWorkDir = getPluginWorkDir;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue