mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 02:05:56 +01:00
[IMPL] Changed to CLI tool
This commit is contained in:
@@ -1,9 +1,32 @@
|
||||
package at.pcgamingfreaks.mkvaudiosubtitlechanger;
|
||||
|
||||
import at.pcgamingfreaks.yaml.YAML;
|
||||
import at.pcgamingfreaks.yaml.YamlInvalidContentException;
|
||||
import at.pcgamingfreaks.yaml.YamlKeyNotFoundException;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@Log4j2
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
MKVToolProperties.getInstance().defineMKVToolNixPath();
|
||||
AttributeUpdaterKernel kernel = new AttributeUpdaterKernel();
|
||||
kernel.execute();
|
||||
if(checkIfMKVToolNixIsValid()){
|
||||
AttributeUpdaterKernel kernel = new AttributeUpdaterKernel();
|
||||
kernel.execute(args[0]);
|
||||
}else{
|
||||
log.error("MKVToolNix was not found! Please recheck path");
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkIfMKVToolNixIsValid() {
|
||||
try{
|
||||
String path = new YAML(new File("config.yml")).getString("mkvtoolnixPath");
|
||||
MKVToolProperties.getInstance().setMkvmergePath(path + "mkvmerge");
|
||||
MKVToolProperties.getInstance().setMkvpropeditPath(path + "mkvproperties");
|
||||
}catch(YamlKeyNotFoundException | IOException | YamlInvalidContentException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new File(MKVToolProperties.getInstance().getMkvmergePath()).isFile() && new File(MKVToolProperties.getInstance().getMkvpropeditPath()).isFile();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user