Skip to content

Commit

Permalink
Merge pull request #4 from GregoryWullimann/master
Browse files Browse the repository at this point in the history
Fixed trim function and home path
  • Loading branch information
pietrop authored Mar 26, 2019
2 parents 048ab96 + dccf65f commit 3e32e01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
if (fileName !== undefined) {
// handle files
document.querySelector('#aeneaLinuxPath').innerText = fileName;
global.setOptionalPathToAeneasBinary(fileName.trim());
global.setOptionalPathToAeneasBinary(fileName[0].trim());
}
})
}
Expand Down
10 changes: 9 additions & 1 deletion src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ var electronShell = require("electron").shell;
var dataPath = currentWindow.dataPath.replace(/ /g,"\\ ");
var desktopPath = currentWindow.desktopPath;
var appPath = currentWindow.appPath;
var homePath = electron.remote.app.getPath('home');


console.info("dataPath",dataPath);
console.info("desktopPath",desktopPath);
console.info("appPath",appPath);
console.info("homePath",homePath);


var selectFileBtnEl = document.getElementById('selectFileBtn');
Expand Down Expand Up @@ -150,13 +152,19 @@ createSubtitlesEl.onclick = function(){
// var subtitlesComposer = require('../node_modules/subtitlescomposer');
var tmpOutputFilePath = path.join(desktopPath, tmpOutputFileName);

fs.mkdir(homePath+"/tmp",function(err){
if (!err) {
console.log("tmp directory created successfully!");
}
});

subtitlescomposer({
punctuationTextContent: getContentFromTextEditor(),
// the number of character per srt subtitle file line.
// TODO: add param to specify with default
numberOfCharPerLine: getCharPerLineInput(),
// where to save intermediate segmented text file needed for aeneas module
segmentedTextInput: appPath+"/src/tmp/segmentedtext.tmp.txt",
segmentedTextInput: homePath+"/tmp/segmentedtext.tmp.txt",
//audio or video file to use for aeneas alignement as original source
mediaFile: sourceVideoPath,
outputCaptionFile: tmpOutputFilePath,
Expand Down

0 comments on commit 3e32e01

Please sign in to comment.