mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 02:05:56 +01:00
[FIX] jar
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -40,7 +40,7 @@
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
<Main-Class>Main</Main-Class>
|
||||
<Main-Class>at/pcgamingfreaks/mkvaudiosubtitlechanger/Main</Main-Class>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.AttributeUpdaterKernel;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
||||
@Log4j2
|
||||
public class Main {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
// MKVToolProperties.getInstance().defineMKVToolNixPath();
|
||||
// GUI gui = new GUI();
|
||||
AttributeUpdaterKernel kernel = new AttributeUpdaterKernel();
|
||||
kernel.execute();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package config;
|
||||
package at.pcgamingfreaks.mkvaudiosubtitlechanger;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
@@ -1,7 +1,5 @@
|
||||
package at.pcgamingfreaks.mkvaudiosubtitlechanger;
|
||||
|
||||
import config.MKVToolProperties;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
MKVToolProperties.getInstance().defineMKVToolNixPath();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package at.pcgamingfreaks.mkvaudiosubtitlechanger.config;
|
||||
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.MKVToolProperties;
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.model.FileAttribute;
|
||||
import config.MKVToolProperties;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
@@ -13,8 +13,8 @@ import java.util.List;
|
||||
|
||||
@Log4j2
|
||||
public class ConfigProcessor {
|
||||
private int audioDefault = 0;
|
||||
private int subtitleDefault = 0;
|
||||
private int audioDefault = - 1;
|
||||
private int subtitleDefault = - 1;
|
||||
private final AttributeConfig config;
|
||||
|
||||
public ConfigProcessor(AttributeConfig config) {
|
||||
@@ -87,8 +87,12 @@ public class ConfigProcessor {
|
||||
StringBuilder stringBuffer = new StringBuilder("\"");
|
||||
stringBuffer.append(MKVToolProperties.getInstance().getMkvpropeditPath());
|
||||
stringBuffer.append("\" \"").append(file.getAbsolutePath()).append("\" ");
|
||||
stringBuffer.append("--edit track:=").append(subtitleDefault).append(" --set flag-default=0 ");
|
||||
stringBuffer.append("--edit track:=").append(audioDefault).append(" --set flag-default=0 ");
|
||||
if(audioDefault != - 1){
|
||||
stringBuffer.append("--edit track:=").append(audioDefault).append(" --set flag-default=0 ");
|
||||
}
|
||||
if(subtitleDefault != - 1){
|
||||
stringBuffer.append("--edit track:=").append(subtitleDefault).append(" --set flag-default=0 ");
|
||||
}
|
||||
collectLines(attributes, transfer);
|
||||
if(transfer.isValid){
|
||||
if(transfer.isAudioOn){
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package at.pcgamingfreaks.mkvaudiosubtitlechanger.intimpl;
|
||||
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.MKVToolProperties;
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.model.FileAttribute;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import config.MKVToolProperties;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
||||
import java.io.File;
|
||||
@@ -56,6 +56,8 @@ public class MkvFileCollector implements FileCollector {
|
||||
public List<FileAttribute> loadAttributes(File file) {
|
||||
Map<String, Object> jsonMap;
|
||||
List<FileAttribute> fileAttributes = new ArrayList<>();
|
||||
System.out.println("\"" + MKVToolProperties.getInstance().getMkvmergePath()
|
||||
+ "\" --identify --identification-format json \"" + file.getAbsolutePath() + "\"");
|
||||
try(InputStream inputStream =
|
||||
Runtime.getRuntime().exec("\"" + MKVToolProperties.getInstance().getMkvmergePath()
|
||||
+ "\" --identify --identification-format json \"" + file.getAbsolutePath() + "\"").getInputStream()){
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
|
||||
@Log4j2
|
||||
public class ConfigUtil {
|
||||
public static List<AttributeConfig> loadConfig() {
|
||||
try(YAML yaml = new YAML(new File("./src/main/resources/config.yaml"))){
|
||||
try(YAML yaml = new YAML(new File("config.yaml"))){
|
||||
return yaml.getKeysFiltered(".*audio.*").stream()
|
||||
.sorted()
|
||||
.map(elem -> elem.replace(".audio", ""))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package query;
|
||||
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.MKVToolProperties;
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.model.FileAttribute;
|
||||
import at.pcgamingfreaks.yaml.YAML;
|
||||
import at.pcgamingfreaks.yaml.YamlInvalidContentException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import config.MKVToolProperties;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
||||
import java.io.File;
|
||||
@@ -21,7 +21,7 @@ import java.util.stream.Stream;
|
||||
|
||||
@Log4j2
|
||||
public class QueryBuilder {
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
private final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
public QueryBuilder() {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package config;
|
||||
|
||||
import at.pcgamingfreaks.mkvaudiosubtitlechanger.MKVToolProperties;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
Reference in New Issue
Block a user