mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 02:05:56 +01:00
[IMPL] config file implemented
This commit is contained in:
@@ -4,6 +4,7 @@ import model.FileAttribute;
|
||||
import query.QueryBuilder;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.DefaultCaret;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -30,6 +31,8 @@ public class GUI {
|
||||
JPanel top = new JPanel(new GridLayout(1, 3, 20, 20));
|
||||
|
||||
outputArea = new JTextArea();
|
||||
DefaultCaret caret = (DefaultCaret) outputArea.getCaret();
|
||||
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
|
||||
PrintStream printStream = new PrintStream(new CustomOutputStream(outputArea));
|
||||
System.setOut(printStream);
|
||||
System.setErr(printStream);
|
||||
|
||||
@@ -85,12 +85,10 @@ public class QueryBuilder {
|
||||
List<String> audios = null;
|
||||
|
||||
try{
|
||||
yaml = new YAML(new File("src/main/resources/config.yaml"));
|
||||
yaml = new YAML(new File("config.yaml"));
|
||||
subtitles = yaml.getStringList("subtitle", null);
|
||||
audios = yaml.getStringList("audio", null);
|
||||
}catch(YamlInvalidContentException | IOException e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
if(fileAttributes.size() > 2 && subtitles != null && audios != null){
|
||||
|
||||
@@ -145,8 +143,12 @@ public class QueryBuilder {
|
||||
log.error("Couldn't make changes to file");
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
log.info("There were not enough lines provided to make any changes to the file");
|
||||
}
|
||||
}catch(YamlInvalidContentException | IOException e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ audio:
|
||||
- ger
|
||||
- eng
|
||||
subtitle:
|
||||
- ger
|
||||
- eng
|
||||
- ger
|
||||
Reference in New Issue
Block a user