Added options to disable parellelisation

This commit is contained in:
Maschell 2018-12-06 17:10:15 +01:00
parent 8ef84f48dd
commit a46011c6ea
2 changed files with 3 additions and 2 deletions

View File

@ -95,7 +95,7 @@ public final class ExtractionService {
public void extractEncryptedContentFilesTo(List<Content> list, String outputFolder, boolean withHashes) throws IOException {
Utils.createDir(outputFolder);
if (parallelizable) {
if (parallelizable && Settings.ALLOW_PARALLELISATION) {
try {
CompletableFuture.allOf(list.stream().map((Content c) -> CompletableFuture.runAsync(() -> {
try {
@ -105,7 +105,7 @@ public final class ExtractionService {
}
})).toArray(CompletableFuture[]::new)).get();
} catch (InterruptedException | ExecutionException e) {
throw new IOException(e);
throw new RuntimeException(e);
}
} else {
for (Content c : list) {

View File

@ -29,6 +29,7 @@ public class Settings {
public static final String WOOMY_METADATA_FILENAME = "metadata.xml";
public static final String H3_EXTENTION = ".h3";
public static final String USER_AGENT = "Mozilla/5.0 (Nintendo WiiU) AppleWebKit/536.28 (KHTML, like Gecko) NX/3.0.3.12.12 NintendoBrowser/3.0.0.9561.US";
public static final boolean ALLOW_PARALLELISATION = true;
public static byte[] commonKey = new byte[0x10];
public static int WIIU_DECRYPTED_AREA_OFFSET = 0x18000;