@ -36,12 +36,15 @@ function parseDuration(str) {
return ( ( ( ( hours * 60 ) + minutes ) * 60 ) + seconds ) + ( ms / 1000 ) ;
return ( ( ( ( hours * 60 ) + minutes ) * 60 ) + seconds ) + ( ms / 1000 ) ;
}
}
function getOutDir ( customOutDir , filePath ) {
const dirname = path . dirname ( filePath ) ;
return customOutDir || dirname ;
}
function getOutPath ( customOutDir , filePath , nameSuffix ) {
function getOutPath ( customOutDir , filePath , nameSuffix ) {
const basename = path . basename ( filePath ) ;
const basename = path . basename ( filePath ) ;
return customOutDir
return path . join ( getOutDir ( customOutDir , filePath ) , ` ${ basename } - ${ nameSuffix } ` ) ;
? path . join ( customOutDir , ` ${ basename } - ${ nameSuffix } ` )
: ` ${ filePath } - ${ nameSuffix } ` ;
}
}
async function transferTimestamps ( inPath , outPath ) {
async function transferTimestamps ( inPath , outPath ) {
@ -114,6 +117,7 @@ module.exports = {
formatDuration ,
formatDuration ,
parseDuration ,
parseDuration ,
getOutPath ,
getOutPath ,
getOutDir ,
transferTimestamps ,
transferTimestamps ,
transferTimestampsWithOffset ,
transferTimestampsWithOffset ,
toast ,
toast ,