Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'createSample'(filePath) {
console.log(filePath)
var inputFile = filePath
var outputFile = filePath.split(".")
outputFile[outputFile.length - 2] = outputFile[outputFile.length - 2] + " - TdarrSample"
outputFile = outputFile.join(".")
outputFile = outputFile.split("/")
outputFile = homePath + "/Tdarr/Samples/" + outputFile[outputFile.length - 1]
var inputFileUnix = inputFile.replace(/'/g, '\'\"\'\"\'');
var outputFileUnix = outputFile.replace(/'/g, '\'\"\'\"\'');
var ffmpegPathUnix = ffmpegPath.replace(/'/g, '\'\"\'\"\'');
var preset1 = "-ss 00:00:1"
var preset2 = "-t 00:00:30 -map 0:v? -map 0:a? -map 0:s? -map 0:d? -c copy"
// var preset1 = "-ss 00:00:1"
// var preset2 = "-t 00:00:30 -c copy -map 0"
if (fs.existsSync(outputFile)) {
fs.unlinkSync(outputFile)
}
if (process.platform == 'win32') {