[FIX] Linux compatibility

This commit is contained in:
2020-06-04 23:07:32 +02:00
parent aebc89fcae
commit 79fa6de190
6 changed files with 51 additions and 15 deletions

View File

@@ -21,12 +21,17 @@ public class Main {
private static boolean checkIfMKVToolNixIsValid() {
try{
String path = new YAML(new File("config.yml")).getString("mkvtoolnixPath");
String path = new YAML(new File("config.yaml")).getString("mkvtoolnixPath");
if(! path.endsWith(File.separator)){
path += File.separator;
}
MKVToolProperties.getInstance().setMkvmergePath(path + "mkvmerge");
MKVToolProperties.getInstance().setMkvpropeditPath(path + "mkvproperties");
if(System.getProperty("os.name").toLowerCase().contains("windows")){
MKVToolProperties.getInstance().setMkvmergePath(path + "mkvmerge.exe");
MKVToolProperties.getInstance().setMkvpropeditPath(path + "mkvpropedit.exe");
}else{
MKVToolProperties.getInstance().setMkvmergePath(path + "mkvmerge");
MKVToolProperties.getInstance().setMkvpropeditPath(path + "mkvpropedit");
}
}catch(YamlKeyNotFoundException | IOException | YamlInvalidContentException e){
e.printStackTrace();
}