diff --git a/CHANGELIST.md b/CHANGELIST.md index 5daed0cc..08f07f4c 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -10,6 +10,8 @@ - Cleanup !protectionInfo.txt (Deterous) - Update Redumper to build 311 (Deterous) - Use PSX/PS2 serial as filename when Volume Label not present (Deterous) +- Allow variables in output path (Deterous) +- Check for presence of complete dump from other programs (Deterous) ### 3.0.3 (2023-12-04) diff --git a/MPF.Core/UI/ViewModels/MainViewModel.cs b/MPF.Core/UI/ViewModels/MainViewModel.cs index 3c4a42a5..7c4d87f1 100644 --- a/MPF.Core/UI/ViewModels/MainViewModel.cs +++ b/MPF.Core/UI/ViewModels/MainViewModel.cs @@ -50,7 +50,7 @@ namespace MPF.Core.UI.ViewModels /// /// /// T1 - Title to display to the user - /// T1 - Message to display to the user + /// T2 - Message to display to the user /// T3 - Number of default options to display /// T4 - true for inquiry, false otherwise /// TResult - true for positive, false for negative, null for neutral @@ -1774,6 +1774,51 @@ namespace MPF.Core.UI.ViewModels } } + // If a complete dump exists from a different program + InternalProgram? programFound = null; + if (programFound == null && _environment.InternalProgram != InternalProgram.Aaru) + { + Modules.Aaru.Parameters parameters = new("") + { + Type = _environment.Type, + System = _environment.System + }; + (bool foundOtherFiles, _) = parameters.FoundAllFiles(outputDirectory, outputFilename, true); + if (foundOtherFiles) + programFound = InternalProgram.Aaru; + } + if (programFound == null && _environment.InternalProgram != InternalProgram.DiscImageCreator) + { + Modules.DiscImageCreator.Parameters parameters = new("") + { + Type = _environment.Type, + System = _environment.System + }; + (bool foundOtherFiles, _) = parameters.FoundAllFiles(outputDirectory, outputFilename, true); + if (foundOtherFiles) + programFound = InternalProgram.DiscImageCreator; + } + if (programFound == null && _environment.InternalProgram != InternalProgram.Redumper) + { + Modules.Redumper.Parameters parameters = new("") + { + Type = _environment.Type, + System = _environment.System + }; + (bool foundOtherFiles, _) = parameters.FoundAllFiles(outputDirectory, outputFilename, true); + if (foundOtherFiles) + programFound = InternalProgram.Redumper; + } + if (programFound != null && _displayUserMessage != null) + { + bool? mbresult = _displayUserMessage("Overwrite?", $"A complete dump from {programFound} already exists! Dumping here may cause issues. Are you sure you want to overwrite?", 2, true); + if (mbresult != true) + { + LogLn("Dumping aborted!"); + return false; + } + } + // Validate that at least some space exists // TODO: Tie this to the size of the disc, type of disc, etc. string fullPath;