mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-11 00:10:29 -07:00
Use async fileExists
This commit is contained in:
parent
99160eadb3
commit
28192d7723
5 changed files with 21 additions and 15 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import fs from 'fs';
|
||||
import fileMoveOrCopy from '../../../../FlowHelpers/1.0.0/fileMoveOrCopy';
|
||||
import {
|
||||
fileExists,
|
||||
getContainer, getFileAbosluteDir, getFileName,
|
||||
} from '../../../../FlowHelpers/1.0.0/fileUtils';
|
||||
import {
|
||||
|
|
@ -76,7 +77,7 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
|
||||
// delete original file
|
||||
if (
|
||||
fs.existsSync(args.originalLibraryFile._id)
|
||||
await fileExists(args.originalLibraryFile._id)
|
||||
&& args.originalLibraryFile._id !== currentPath
|
||||
) {
|
||||
args.jobLog(`Deleting original file:${args.originalLibraryFile._id}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue