Fix execution on linux

This commit is contained in:
RatzzFatzz
2025-02-18 19:15:02 +01:00
parent e81b06f6fa
commit 8f38abcf3a
2 changed files with 11 additions and 10 deletions

View File

@@ -39,16 +39,17 @@ public class MkvFileProcessor implements FileProcessor {
Map<String, Object> jsonMap;
List<FileAttribute> fileAttributes = new ArrayList<>();
try {
String command = format("\"%s\"", Config.getInstance().getPathFor(MkvToolNix.MKV_MERGE));
String[] arguments = new String[]{
command,
String[] command = new String[]{
Config.getInstance().getPathFor(MkvToolNix.MKV_MERGE),
"--identify",
"--identification-format",
"json",
file.getAbsoluteFile().toString()
file.getAbsolutePath()
};
InputStream inputStream = Runtime.getRuntime().exec(arguments).getInputStream();
log.debug("{}", String.join(" ", command));
InputStream inputStream = Runtime.getRuntime().exec(command)
.getInputStream();
jsonMap = mapper.readValue(inputStream, Map.class);
List<Map<String, Object>> tracks = (List<Map<String, Object>>) jsonMap.get("tracks");
if (tracks == null) {

View File

@@ -3,8 +3,8 @@ Configuration:
Appenders:
RollingFile:
name: FileAppender
fileName: /var/log/MKVAudioSubtitleChanger/application.log
filePattern: /var/log/MKVAudioSubtitleChanger/archive/application-%d{yyyy-MM-dd}-%i.log.gz
fileName: ${sys:user.home}/.local/mkvaudiosubtitlechanger/logs/application.log
filePattern: ${sys:user.home}/.local/mkvaudiosubtitlechanger/logs/archive/application-%d{yyyy-MM-dd}-%i.log.gz
PatternLayout:
Pattern: "%d{DEFAULT} | %-5level | %thread | %msg %n %throwable"
ThresholdFilter: