mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-14 09:45:55 -07:00
Update file operation plugins
This commit is contained in:
parent
579aab99e9
commit
80f02bf810
22 changed files with 692 additions and 47 deletions
|
|
@ -14,6 +14,12 @@ export const getFileName = (filePath: string): string => {
|
|||
return parts2.join('.');
|
||||
};
|
||||
|
||||
export const getFileAbosluteDir = (filePath: string):string => {
|
||||
const parts = filePath.split('/');
|
||||
parts.pop();
|
||||
return parts.join('/');
|
||||
};
|
||||
|
||||
export const getFfType = (codecType: string): string => (codecType === 'video' ? 'v' : 'a');
|
||||
|
||||
export const getSubStem = ({
|
||||
|
|
@ -92,3 +98,9 @@ export const moveFileAndValidate = async ({
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const getPluginWorkDir = (args: IpluginInputArgs):string => {
|
||||
const pluginWorkDir = `${args.workDir}/${new Date().getTime()}`;
|
||||
args.deps.fsextra.ensureDirSync(pluginWorkDir);
|
||||
return pluginWorkDir;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue