[IMPL] Default Kernel

This commit is contained in:
2020-04-05 19:30:52 +02:00
parent f55134c91a
commit cf2fdcb30e
2 changed files with 34 additions and 1 deletions

View File

@@ -1,12 +1,30 @@
package at.pcgamingfreaks.mkvaudiosubtitlechanger;
import at.pcgamingfreaks.mkvaudiosubtitlechanger.config.AttributeConfig;
import at.pcgamingfreaks.mkvaudiosubtitlechanger.intimpl.MkvFileCollector;
import at.pcgamingfreaks.mkvaudiosubtitlechanger.model.FileAttribute;
import at.pcgamingfreaks.mkvaudiosubtitlechanger.util.ConfigUtil;
import java.io.File;
import java.util.List;
import java.util.Scanner;
public class AttributeUpdaterKernel {
MkvFileCollector collector = new MkvFileCollector();
public void execute() {
List<AttributeConfig> list = ConfigUtil.loadConfig();
List<AttributeConfig> configPattern = ConfigUtil.loadConfig();
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter the path to the files which should be updated: ");
List<File> allValidPaths = collector.loadFiles(scanner.nextLine());
for(File file: allValidPaths) {
List<FileAttribute> attributes = collector.loadAttributes(file);
for(AttributeConfig config: configPattern) {
boolean fileIsChanged = config.processConfig(file, attributes);
if(fileIsChanged) {
break;
}
}
}
}
}