From 53443ef0dc34103f73824db16b766f0aef91fc0a Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 15 Apr 2019 19:28:29 +0200 Subject: [PATCH] Add supported for splitted WUD files --- .../fuse_wiiu/utils/FuseContainerWrapper.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java index cd5175d..4008b6b 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java @@ -12,6 +12,7 @@ import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDFuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDMountedFuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; +import de.mas.wiiu.jnus.implementations.wud.reader.WUDDiscReaderSplitted; import de.mas.wiiu.jnus.utils.Utils; public class FuseContainerWrapper { @@ -39,12 +40,8 @@ public class FuseContainerWrapper { } } - if (c.exists() && c.isFile() && (c.getName().endsWith(".wux") || c.getName().endsWith(".wud") || c.getName().endsWith(".ddi"))) { - - result.put(prefix + c.getName(), new WUDFuseContainer(parent, c)); - result.put(prefix + "[EXTRA] " + c.getName(), new WUDMountedFuseContainer(parent, c)); + if (checkWUD(result, parent, c)) { return result; - } if (c.isDirectory()) { @@ -55,4 +52,18 @@ public class FuseContainerWrapper { return result; } + private static boolean checkWUD(Map result, Optional parent, File c) { + if (c.exists() && c.isFile() && (c.getName().endsWith(".wux") || c.getName().endsWith(".wud") || c.getName().endsWith(".ddi"))) { + if (c.length() == WUDDiscReaderSplitted.WUD_SPLITTED_FILE_SIZE && !c.getName().endsWith("part1.wud")) { + return false; + } + + result.put(prefix + c.getName(), new WUDFuseContainer(parent, c)); + result.put(prefix + "[EXTRA] " + c.getName(), new WUDMountedFuseContainer(parent, c)); + return true; + + } + return false; + } + }