From 4e3a531d633c52f6c5ccf6df3dbe2cef362e6571 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 8 Mar 2026 20:28:39 -0400 Subject: [PATCH] Update RedumpLib to 1.10.0 --- CHANGELIST.md | 1 + MPF.CLI/MPF.CLI.csproj | 2 +- MPF.Check/Features/InteractiveFeature.cs | 80 +++++++++++++------ MPF.Check/Features/MainFeature.cs | 18 +++++ MPF.Check/MPF.Check.csproj | 2 +- MPF.Check/Program.cs | 2 + .../MPF.ExecutionContexts.Test.csproj | 2 +- .../MPF.ExecutionContexts.csproj | 2 +- MPF.Frontend.Test/MPF.Frontend.Test.csproj | 2 +- MPF.Frontend/Features/ListConfigFeature.cs | 2 + MPF.Frontend/MPF.Frontend.csproj | 2 +- MPF.Frontend/Options.cs | 14 ++++ MPF.Frontend/Tools/OptionsLoader.cs | 4 + MPF.Frontend/Tools/SubmissionGenerator.cs | 9 ++- .../MPF.Processors.Test.csproj | 2 +- MPF.Processors/MPF.Processors.csproj | 2 +- MPF.UI/MPF.UI.csproj | 2 +- 17 files changed, 113 insertions(+), 35 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 4b3030d6..70132583 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -57,6 +57,7 @@ - Add Portuguese translation (Kokasgui) - Wire up Portuguese translation, fix Redumper enum - Add Portuguese to UI code +- Update RedumpLib to 1.10.0 ### 3.6.0 (2025-11-28) diff --git a/MPF.CLI/MPF.CLI.csproj b/MPF.CLI/MPF.CLI.csproj index 70175cea..87a8337f 100644 --- a/MPF.CLI/MPF.CLI.csproj +++ b/MPF.CLI/MPF.CLI.csproj @@ -44,7 +44,7 @@ - + \ No newline at end of file diff --git a/MPF.Check/Features/InteractiveFeature.cs b/MPF.Check/Features/InteractiveFeature.cs index 65f0d992..0439f797 100644 --- a/MPF.Check/Features/InteractiveFeature.cs +++ b/MPF.Check/Features/InteractiveFeature.cs @@ -54,6 +54,8 @@ namespace MPF.Check.Features Options.Processing.Login.RedumpUsername = null; Options.Processing.Login.RedumpPassword = null; Options.Processing.Login.RetrieveMatchInformation = true; + Options.Processing.Login.AttemptCount = 3; + Options.Processing.Login.TimeoutSeconds = 30; // Media Information Options.Processing.MediaInformation.AddPlaceholders = true; @@ -92,18 +94,20 @@ namespace MPF.Check.Features Console.WriteLine($"5) Create IRD (Currently '{Options.Processing.CreateIRDAfterDumping}')"); Console.WriteLine($"6) Attempt Redump matches (Currently '{Options.Processing.Login.RetrieveMatchInformation}')"); Console.WriteLine($"7) Redump credentials (Currently '{Options.Processing.Login.RedumpUsername}')"); - Console.WriteLine($"8) Pull all information (Currently '{Options.Processing.Login.PullAllInformation}')"); - Console.WriteLine($"9) Set device path (Currently '{DevicePath}')"); - Console.WriteLine($"A) Scan for protection (Currently '{scan}')"); - Console.WriteLine($"B) Scan archives for protection (Currently '{enableArchives}')"); - Console.WriteLine($"C) Debug protection scan output (Currently '{enableDebug}')"); - Console.WriteLine($"D) Hide drive letters in protection output (Currently '{hideDriveLetters}')"); - Console.WriteLine($"E) Hide filename suffix (Currently '{Options.Processing.AddFilenameSuffix}')"); - Console.WriteLine($"F) Output submission JSON (Currently '{Options.Processing.OutputSubmissionJSON}')"); - Console.WriteLine($"G) Include JSON artifacts (Currently '{Options.Processing.IncludeArtifacts}')"); - Console.WriteLine($"H) Compress logs (Currently '{Options.Processing.CompressLogFiles}')"); - Console.WriteLine($"I) Log compression (Currently '{Options.Processing.LogCompression.LongName()}')"); - Console.WriteLine($"J) Delete unnecessary files (Currently '{Options.Processing.DeleteUnnecessaryFiles}')"); + Console.WriteLine($"8) Redump client attempt count (Currently '{Options.Processing.Login.AttemptCount}')"); + Console.WriteLine($"9) Redump client timeout in seconds (Currently '{Options.Processing.Login.TimeoutSeconds}')"); + Console.WriteLine($"A) Pull all information (Currently '{Options.Processing.Login.PullAllInformation}')"); + Console.WriteLine($"B) Set device path (Currently '{DevicePath}')"); + Console.WriteLine($"C) Scan for protection (Currently '{scan}')"); + Console.WriteLine($"D) Scan archives for protection (Currently '{enableArchives}')"); + Console.WriteLine($"E) Debug protection scan output (Currently '{enableDebug}')"); + Console.WriteLine($"F) Hide drive letters in protection output (Currently '{hideDriveLetters}')"); + Console.WriteLine($"G) Hide filename suffix (Currently '{Options.Processing.AddFilenameSuffix}')"); + Console.WriteLine($"H) Output submission JSON (Currently '{Options.Processing.OutputSubmissionJSON}')"); + Console.WriteLine($"I) Include JSON artifacts (Currently '{Options.Processing.IncludeArtifacts}')"); + Console.WriteLine($"J) Compress logs (Currently '{Options.Processing.CompressLogFiles}')"); + Console.WriteLine($"K) Log compression (Currently '{Options.Processing.LogCompression.LongName()}')"); + Console.WriteLine($"L) Delete unnecessary files (Currently '{Options.Processing.DeleteUnnecessaryFiles}')"); Console.WriteLine(); Console.WriteLine($"Q) Exit the program"); Console.WriteLine($"X) Start checking"); @@ -130,47 +134,53 @@ namespace MPF.Check.Features case "7": goto redumpCredentials; case "8": - Options.Processing.Login.PullAllInformation = !Options.Processing.Login.PullAllInformation; - goto root; + goto attemptCount; case "9": - goto devicePath; + goto timeoutSeconds; case "a": case "A": - scan = !scan; + Options.Processing.Login.PullAllInformation = !Options.Processing.Login.PullAllInformation; goto root; case "b": case "B": - enableArchives = !enableArchives; - goto root; + goto devicePath; case "c": case "C": - enableDebug = !enableDebug; + scan = !scan; goto root; case "d": case "D": - hideDriveLetters = !hideDriveLetters; + enableArchives = !enableArchives; goto root; case "e": case "E": - Options.Processing.AddFilenameSuffix = !Options.Processing.AddFilenameSuffix; + enableDebug = !enableDebug; goto root; case "f": case "F": - Options.Processing.OutputSubmissionJSON = !Options.Processing.OutputSubmissionJSON; + hideDriveLetters = !hideDriveLetters; goto root; case "g": case "G": - Options.Processing.IncludeArtifacts = !Options.Processing.IncludeArtifacts; + Options.Processing.AddFilenameSuffix = !Options.Processing.AddFilenameSuffix; goto root; case "h": case "H": - Options.Processing.CompressLogFiles = !Options.Processing.CompressLogFiles; + Options.Processing.OutputSubmissionJSON = !Options.Processing.OutputSubmissionJSON; goto root; case "i": case "I": - goto logCompression; + Options.Processing.IncludeArtifacts = !Options.Processing.IncludeArtifacts; + goto root; case "j": case "J": + Options.Processing.CompressLogFiles = !Options.Processing.CompressLogFiles; + goto root; + case "k": + case "K": + goto logCompression; + case "l": + case "L": Options.Processing.DeleteUnnecessaryFiles = !Options.Processing.DeleteUnnecessaryFiles; goto root; @@ -251,6 +261,26 @@ namespace MPF.Check.Features goto root; + attemptCount: + Console.WriteLine(); + Console.WriteLine("Enter your attempt count and press Enter:"); + Console.Write("> "); + string possibleAttemptCount = Console.ReadLine(); + if (int.TryParse(possibleAttemptCount, out int attemptCount) && attemptCount > 0) + Options.Processing.Login.AttemptCount = attemptCount; + + goto root; + + timeoutSeconds: + Console.WriteLine(); + Console.WriteLine("Enter your timeout in seconds and press Enter:"); + Console.Write("> "); + string possibleTimeout = Console.ReadLine(); + if (int.TryParse(possibleTimeout, out int timeoutSeconds) && timeoutSeconds > 0) + Options.Processing.Login.TimeoutSeconds = timeoutSeconds; + + goto root; + devicePath: Console.WriteLine(); Console.WriteLine("Input the device path and press Enter:"); diff --git a/MPF.Check/Features/MainFeature.cs b/MPF.Check/Features/MainFeature.cs index f74d95b4..5f982cbe 100644 --- a/MPF.Check/Features/MainFeature.cs +++ b/MPF.Check/Features/MainFeature.cs @@ -24,6 +24,9 @@ namespace MPF.Check.Features #region Inputs + private const string _attemptCountName = "attempt-count"; + internal readonly Int32Input AttemptCountInput = new(_attemptCountName, "--attempt-count", "Set Redump client attempt count (must be greater than 0)"); + private const string _createIrdName = "create-ird"; internal readonly FlagInput CreateIrdInput = new(_createIrdName, "--create-ird", "Create IRD from output files (PS3 only)"); @@ -72,6 +75,9 @@ namespace MPF.Check.Features private const string _suffixName = "suffix"; internal readonly FlagInput SuffixInput = new(_suffixName, ["-x", "--suffix"], "Enable adding filename suffix"); + private const string _timeoutSecondsName = "timeout-secondss"; + internal readonly Int32Input TimeoutSecondsInput = new(_timeoutSecondsName, "--timeout-seconds", "Set Redump client timeout in seconds (must be greater than 0)"); + private const string _useName = "use"; internal readonly StringInput UseInput = new(_useName, ["-u", "--use"], "Override configured dumping program name"); @@ -93,6 +99,8 @@ namespace MPF.Check.Features Add(NoRetrieveInput); Add(UsernameInput); Add(PasswordInput); + Add(AttemptCountInput); + Add(TimeoutSecondsInput); Add(PullAllInput); Add(PathInput); Add(ScanInput); @@ -140,6 +148,8 @@ namespace MPF.Check.Features Options.Processing.Login.RedumpUsername = null; Options.Processing.Login.RedumpPassword = null; Options.Processing.Login.RetrieveMatchInformation = true; + Options.Processing.Login.AttemptCount = 3; + Options.Processing.Login.TimeoutSeconds = 30; // Media Information Options.Processing.MediaInformation.AddPlaceholders = true; @@ -196,6 +206,14 @@ namespace MPF.Check.Features else if (PasswordInput.ProcessInput(args, ref index)) Options.Processing.Login.RedumpPassword = PasswordInput.Value; + // Attempt count + else if (AttemptCountInput.ProcessInput(args, ref index) && AttemptCountInput.Value > 0) + Options.Processing.Login.AttemptCount = AttemptCountInput.Value ?? 3; + + // Timeout seconds + else if (TimeoutSecondsInput.ProcessInput(args, ref index) && TimeoutSecondsInput.Value > 0) + Options.Processing.Login.TimeoutSeconds = TimeoutSecondsInput.Value ?? 30; + // Pull all information (requires Redump login) else if (PullAllInput.ProcessInput(args, ref index)) Options.Processing.Login.PullAllInformation = !Options.Processing.Login.PullAllInformation; diff --git a/MPF.Check/MPF.Check.csproj b/MPF.Check/MPF.Check.csproj index 35bfb213..d4753351 100644 --- a/MPF.Check/MPF.Check.csproj +++ b/MPF.Check/MPF.Check.csproj @@ -44,7 +44,7 @@ - + \ No newline at end of file diff --git a/MPF.Check/Program.cs b/MPF.Check/Program.cs index bb468735..addb8efa 100644 --- a/MPF.Check/Program.cs +++ b/MPF.Check/Program.cs @@ -151,6 +151,8 @@ namespace MPF.Check commandSet.Add(mainFeature.NoRetrieveInput); commandSet.Add(mainFeature.UsernameInput); commandSet.Add(mainFeature.PasswordInput); + commandSet.Add(mainFeature.AttemptCountInput); + commandSet.Add(mainFeature.TimeoutSecondsInput); commandSet.Add(mainFeature.PullAllInput); commandSet.Add(mainFeature.PathInput); commandSet.Add(mainFeature.ScanInput); diff --git a/MPF.ExecutionContexts.Test/MPF.ExecutionContexts.Test.csproj b/MPF.ExecutionContexts.Test/MPF.ExecutionContexts.Test.csproj index a5927b2c..58970bd1 100644 --- a/MPF.ExecutionContexts.Test/MPF.ExecutionContexts.Test.csproj +++ b/MPF.ExecutionContexts.Test/MPF.ExecutionContexts.Test.csproj @@ -17,7 +17,7 @@ - + diff --git a/MPF.ExecutionContexts/MPF.ExecutionContexts.csproj b/MPF.ExecutionContexts/MPF.ExecutionContexts.csproj index 21fe997d..9b24901c 100644 --- a/MPF.ExecutionContexts/MPF.ExecutionContexts.csproj +++ b/MPF.ExecutionContexts/MPF.ExecutionContexts.csproj @@ -32,7 +32,7 @@ - + \ No newline at end of file diff --git a/MPF.Frontend.Test/MPF.Frontend.Test.csproj b/MPF.Frontend.Test/MPF.Frontend.Test.csproj index 257d8d88..596f4354 100644 --- a/MPF.Frontend.Test/MPF.Frontend.Test.csproj +++ b/MPF.Frontend.Test/MPF.Frontend.Test.csproj @@ -17,7 +17,7 @@ - + diff --git a/MPF.Frontend/Features/ListConfigFeature.cs b/MPF.Frontend/Features/ListConfigFeature.cs index 5e20789c..df16be3f 100644 --- a/MPF.Frontend/Features/ListConfigFeature.cs +++ b/MPF.Frontend/Features/ListConfigFeature.cs @@ -128,6 +128,8 @@ namespace MPF.Frontend.Features Console.WriteLine($" Redump Username = {options.Processing.Login.RedumpUsername}"); Console.WriteLine($" Redump Password = {(string.IsNullOrEmpty(options.Processing.Login.RedumpPassword) ? "[UNSET]" : "[SET]")}"); Console.WriteLine($" Retrieve Match Information = {options.Processing.Login.RetrieveMatchInformation}"); + Console.WriteLine($" Redump client attempt count = {options.Processing.Login.AttemptCount}"); + Console.WriteLine($" Redump client timeout in seconds = {options.Processing.Login.TimeoutSeconds}"); Console.WriteLine(); // Media Information diff --git a/MPF.Frontend/MPF.Frontend.csproj b/MPF.Frontend/MPF.Frontend.csproj index 47706e35..4e2c8791 100644 --- a/MPF.Frontend/MPF.Frontend.csproj +++ b/MPF.Frontend/MPF.Frontend.csproj @@ -38,7 +38,7 @@ - + diff --git a/MPF.Frontend/Options.cs b/MPF.Frontend/Options.cs index b4f89b64..680405d6 100644 --- a/MPF.Frontend/Options.cs +++ b/MPF.Frontend/Options.cs @@ -151,6 +151,8 @@ namespace MPF.Frontend Processing.Login.RedumpUsername = source.Processing.Login.RedumpUsername; Processing.Login.RedumpPassword = source.Processing.Login.RedumpPassword; Processing.Login.RetrieveMatchInformation = source.Processing.Login.RetrieveMatchInformation; + Processing.Login.AttemptCount = source.Processing.Login.AttemptCount; + Processing.Login.TimeoutSeconds = source.Processing.Login.TimeoutSeconds; Processing.MediaInformation.AddPlaceholders = source.Processing.MediaInformation.AddPlaceholders; Processing.MediaInformation.EnableRedumpCompatibility = source.Processing.MediaInformation.EnableRedumpCompatibility; @@ -730,6 +732,18 @@ namespace MPF.Frontend /// /// Version 1 and greater public bool RetrieveMatchInformation { get; set; } = true; + + /// + /// Maximum attempt count for any operation + /// + /// Value has to be greater than 0 + public int AttemptCount { get; set; } = 3; + + /// + /// The timespan to wait before the request times out. + /// + /// Value has to be greater than 0 + public int TimeoutSeconds { get; set; } = 30; } /// diff --git a/MPF.Frontend/Tools/OptionsLoader.cs b/MPF.Frontend/Tools/OptionsLoader.cs index 69594b6c..199f984d 100644 --- a/MPF.Frontend/Tools/OptionsLoader.cs +++ b/MPF.Frontend/Tools/OptionsLoader.cs @@ -421,6 +421,8 @@ namespace MPF.Frontend.Tools options.Processing.Login.RedumpUsername = GetStringSetting(source, "RedumpUsername", string.Empty); options.Processing.Login.RedumpPassword = GetStringSetting(source, "RedumpPassword", string.Empty); options.Processing.Login.RetrieveMatchInformation = GetBooleanSetting(source, "RetrieveMatchInformation", true); + options.Processing.Login.AttemptCount = GetInt32Setting(source, "AttemptCount", 3); + options.Processing.Login.TimeoutSeconds = GetInt32Setting(source, "TimeoutSeconds", 30); options.Processing.MediaInformation.AddPlaceholders = GetBooleanSetting(source, "AddPlaceholders", true); options.Processing.MediaInformation.EnableRedumpCompatibility = GetBooleanSetting(source, "EnableRedumpCompatibility", true); @@ -529,6 +531,8 @@ namespace MPF.Frontend.Tools { "RetrieveMatchInformation", options.Processing.Login.RetrieveMatchInformation.ToString() }, { "RedumpUsername", options.Processing.Login.RedumpUsername }, { "RedumpPassword", options.Processing.Login.RedumpPassword }, + { "AttemptCount", options.Processing.Login.AttemptCount.ToString() }, + { "TimeoutSeconds", options.Processing.Login.TimeoutSeconds.ToString() }, }; } diff --git a/MPF.Frontend/Tools/SubmissionGenerator.cs b/MPF.Frontend/Tools/SubmissionGenerator.cs index 09521e73..827c9c57 100644 --- a/MPF.Frontend/Tools/SubmissionGenerator.cs +++ b/MPF.Frontend/Tools/SubmissionGenerator.cs @@ -190,7 +190,14 @@ namespace MPF.Frontend.Tools info.PartiallyMatchedIDs = []; // Login to Redump, if possible - var wc = new RedumpClient(); + int attemptCount = options.Processing.Login.AttemptCount; + int timeoutSeconds = options.Processing.Login.TimeoutSeconds; + var wc = new RedumpClient + { + AttemptCount = attemptCount > 0 ? attemptCount : 3, + Timeout = TimeSpan.FromSeconds(timeoutSeconds > 0 ? timeoutSeconds : 30), + }; + if (!string.IsNullOrEmpty(options.Processing.Login.RedumpUsername) && !string.IsNullOrEmpty(options.Processing.Login.RedumpPassword)) { resultProgress?.Report(ResultEventArgs.Neutral("Attempting to log in to Redump, this might take a while...")); diff --git a/MPF.Processors.Test/MPF.Processors.Test.csproj b/MPF.Processors.Test/MPF.Processors.Test.csproj index 98394161..9197591d 100644 --- a/MPF.Processors.Test/MPF.Processors.Test.csproj +++ b/MPF.Processors.Test/MPF.Processors.Test.csproj @@ -27,7 +27,7 @@ - + diff --git a/MPF.Processors/MPF.Processors.csproj b/MPF.Processors/MPF.Processors.csproj index 3f505fad..d449ed03 100644 --- a/MPF.Processors/MPF.Processors.csproj +++ b/MPF.Processors/MPF.Processors.csproj @@ -35,7 +35,7 @@ - + diff --git a/MPF.UI/MPF.UI.csproj b/MPF.UI/MPF.UI.csproj index 2d53ff50..7999abb4 100644 --- a/MPF.UI/MPF.UI.csproj +++ b/MPF.UI/MPF.UI.csproj @@ -70,7 +70,7 @@ - +