Add new copy/move options

This commit is contained in:
HaveAGitGat 2023-08-28 10:43:23 +01:00
parent f410caf1ad
commit ca8ec26b81
9 changed files with 326 additions and 33 deletions

View file

@ -7,7 +7,22 @@ export const getFileName = (filePath: string):string => {
const parts = filePath.split('/');
const fileNameAndContainer = parts[parts.length - 1];
const parts2 = fileNameAndContainer.split('.');
return parts2[0];
parts2.pop();
return parts2.join('.');
};
export const getFfType = (codecType:string):string => (codecType === 'video' ? 'v' : 'a');
export const getSubStem = ({
inputPathStem,
inputPath,
}: {
inputPathStem: string,
inputPath: string,
}):string => {
const subStem = inputPath.substring(inputPathStem.length);
const parts = subStem.split('/');
parts.pop();
return parts.join('/');
};