diff --git a/Ps3DiscDumper/Dumper.cs b/Ps3DiscDumper/Dumper.cs index 9ec5e1e..071eac1 100644 --- a/Ps3DiscDumper/Dumper.cs +++ b/Ps3DiscDumper/Dumper.cs @@ -298,6 +298,13 @@ public void DetectDisc(string inDir = "", Func outputDirFormatte // todo: maybe use discutils instead to read TOC as one block var files = IOEx.GetFilepaths(InputDevicePath, "*", SearchOption.AllDirectories); + if (!SettingsProvider.Settings.CopyBdmv) + { + var prefixList = Settings.BdmvFolders + .Select(f => Path.Combine(InputDevicePath, f) + Path.DirectorySeparatorChar) + .ToArray(); + files = files.Where(f => !prefixList.Any(f.StartsWith)); + } DiscFilenames = new(); var totalFilesize = 0L; var rootLength = InputDevicePath.Length; @@ -518,7 +525,21 @@ public async Task DumpAsync(string output) dumpPath = parent; } if (filesystemStructure is null) + { (filesystemStructure, emptyDirStructure) = GetFilesystemStructure(); + var prefixList = Settings.BdmvFolders.Select(f => f + Path.DirectorySeparatorChar).ToArray(); + if (!SettingsProvider.Settings.CopyBdmv) + { + filesystemStructure = filesystemStructure + .Where(r => !Settings.BdmvFolders.Any(f => r.TargetFileName == f) && + !prefixList.Any(p => r.TargetFileName.StartsWith(p))) + .ToList(); + emptyDirStructure = emptyDirStructure + .Where(r => !Settings.BdmvFolders.Any(f => r.TargetDirName == f) && + !prefixList.Any(p => r.TargetDirName.StartsWith(p))) + .ToList(); + } + } var validators = GetValidationInfo(); if (!string.IsNullOrEmpty(dumpPath)) { diff --git a/Ps3DiscDumper/Settings.cs b/Ps3DiscDumper/Settings.cs index 5b42c9d..a580065 100644 --- a/Ps3DiscDumper/Settings.cs +++ b/Ps3DiscDumper/Settings.cs @@ -11,8 +11,8 @@ public struct Settings { public Settings() { } - [JsonIgnore] - public const string DefaultPattern = $"%{Patterns.Title}% [%{Patterns.ProductCode}%]"; + [JsonIgnore] public const string DefaultPattern = $"%{Patterns.Title}% [%{Patterns.ProductCode}%]"; + [JsonIgnore] public static readonly string[] BdmvFolders = ["BDMV", "AACS", "CERTIFICATE"]; public string OutputDir { get; set; } = "."; public string IrdDir { get; set; } = Path.Combine(Environment.GetFolderPath(SpecialFolder.ApplicationData) ,"ps3-iso-dumper", "ird"); diff --git a/UI.Avalonia/ViewModels/MainViewModel.cs b/UI.Avalonia/ViewModels/MainViewModel.cs index 66552ba..0635299 100644 --- a/UI.Avalonia/ViewModels/MainViewModel.cs +++ b/UI.Avalonia/ViewModels/MainViewModel.cs @@ -181,7 +181,10 @@ IOException when e.Message.Contains("cyclic redundancy check") else if (Directory.Exists(Path.Combine(dumper.InputDevicePath, "BDMV"))) { StepTitle = "Ready to dump a hybrid disc"; - StepSubtitle = "All files will be copied, but only PS3 game files will be decrypted"; + if (CopyBdmv) + StepSubtitle = "All files will be copied, but only PS3 game files will be decrypted"; + else + StepSubtitle = "Only PS3 game files will be copied"; LearnMoreLink = SettingsViewModel.HybridDiscWikiLink; LastOperationNotification = true; }