mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 15:38:19 -07:00
Minor corrections
This commit is contained in:
parent
22a474104a
commit
b85f59da2c
2 changed files with 18 additions and 20 deletions
|
|
@ -169,7 +169,6 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
const arr = String(args.inputs.arr);
|
||||
const arr_host = String(args.inputs.arr_host).trim();
|
||||
const arrHost = arr_host.endsWith('/') ? arr_host.slice(0, -1) : arr_host;
|
||||
const filePath = args.originalLibraryFile?._id ?? '';
|
||||
const originalFileName = args.originalLibraryFile?._id ?? '';
|
||||
const currentFileName = args.inputFileObj?._id ?? '';
|
||||
const headers = {
|
||||
|
|
@ -232,18 +231,18 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
|
||||
// Only if there is a rename to execute
|
||||
if (fileToRename !== undefined) {
|
||||
newPath = `${getFileAbosluteDir(args.inputFileObj._id)
|
||||
newPath = `${getFileAbosluteDir(currentFileName)
|
||||
}/${getFileName(fileToRename.newPath)
|
||||
}.${getContainer(fileToRename.newPath)}`;
|
||||
|
||||
isSuccessful = await fileMoveOrCopy({
|
||||
operation: 'move',
|
||||
sourcePath: args.inputFileObj._id,
|
||||
sourcePath: currentFileName,
|
||||
destinationPath: newPath,
|
||||
args,
|
||||
});
|
||||
args.jobLog(`✔ ${renameType.content} ${fileDetailsWrapper.id} renamed : `
|
||||
+ `'${filePath}' => '${newPath}'.`);
|
||||
+ `'${originalFileName}' => '${newPath}'.`);
|
||||
} else {
|
||||
isSuccessful = true;
|
||||
args.jobLog('✔ No rename necessary.');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue