From ff58e48ce9a6523175bb0d2e18d843b3ae01fd5d Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 7 Feb 2026 20:24:39 -0500 Subject: [PATCH] Further cleanup in Options --- CHANGELIST.md | 1 + MPF.CLI/Features/BaseFeature.cs | 4 +- MPF.Check/Features/BaseFeature.cs | 4 +- MPF.Check/Features/InteractiveFeature.cs | 8 +- MPF.Check/Features/MainFeature.cs | 6 +- MPF.Frontend/Features/ListConfigFeature.cs | 24 ++-- MPF.Frontend/Options.cs | 128 +++++++++++---------- MPF.Frontend/Tools/SubmissionGenerator.cs | 2 +- 8 files changed, 92 insertions(+), 85 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 9312e536..ae9f2ebf 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -31,6 +31,7 @@ - Replace original Options object - Clean up options serialization and ordering - Add placeholder CLI media info methods +- Further cleanup in Options ### 3.6.0 (2025-11-28) diff --git a/MPF.CLI/Features/BaseFeature.cs b/MPF.CLI/Features/BaseFeature.cs index ac7cd82c..a3844ac3 100644 --- a/MPF.CLI/Features/BaseFeature.cs +++ b/MPF.CLI/Features/BaseFeature.cs @@ -77,13 +77,13 @@ namespace MPF.CLI.Features Options.Processing.ProtectionScanning.HideDriveLetters = false; // Redump Login Information - Options.Processing.Login.RetrieveMatchInformation = true; + Options.Processing.Login.PullAllInformation = false; Options.Processing.Login.RedumpUsername = null; Options.Processing.Login.RedumpPassword = null; + Options.Processing.Login.RetrieveMatchInformation = true; // Media Information Options.Processing.MediaInformation.AddPlaceholders = true; - Options.Processing.MediaInformation.PullAllInformation = false; // Post-Information Options Options.Processing.AddFilenameSuffix = false; diff --git a/MPF.Check/Features/BaseFeature.cs b/MPF.Check/Features/BaseFeature.cs index e8b87c54..58fb156e 100644 --- a/MPF.Check/Features/BaseFeature.cs +++ b/MPF.Check/Features/BaseFeature.cs @@ -52,13 +52,13 @@ namespace MPF.Check.Features Options.Processing.ProtectionScanning.HideDriveLetters = false; // Redump Login Information - Options.Processing.Login.RetrieveMatchInformation = true; + Options.Processing.Login.PullAllInformation = false; Options.Processing.Login.RedumpUsername = null; Options.Processing.Login.RedumpPassword = null; + Options.Processing.Login.RetrieveMatchInformation = true; // Media Information Options.Processing.MediaInformation.AddPlaceholders = true; - Options.Processing.MediaInformation.PullAllInformation = false; // Post-Information Options Options.Processing.AddFilenameSuffix = false; diff --git a/MPF.Check/Features/InteractiveFeature.cs b/MPF.Check/Features/InteractiveFeature.cs index 9ef9c584..65f0d992 100644 --- a/MPF.Check/Features/InteractiveFeature.cs +++ b/MPF.Check/Features/InteractiveFeature.cs @@ -50,13 +50,13 @@ namespace MPF.Check.Features Options.Processing.ProtectionScanning.HideDriveLetters = false; // Redump Login Information - Options.Processing.Login.RetrieveMatchInformation = true; + Options.Processing.Login.PullAllInformation = false; Options.Processing.Login.RedumpUsername = null; Options.Processing.Login.RedumpPassword = null; + Options.Processing.Login.RetrieveMatchInformation = true; // Media Information Options.Processing.MediaInformation.AddPlaceholders = true; - Options.Processing.MediaInformation.PullAllInformation = false; // Post-Information Options Options.Processing.AddFilenameSuffix = false; @@ -92,7 +92,7 @@ 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.MediaInformation.PullAllInformation}')"); + 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}')"); @@ -130,7 +130,7 @@ namespace MPF.Check.Features case "7": goto redumpCredentials; case "8": - Options.Processing.MediaInformation.PullAllInformation = !Options.Processing.MediaInformation.PullAllInformation; + Options.Processing.Login.PullAllInformation = !Options.Processing.Login.PullAllInformation; goto root; case "9": goto devicePath; diff --git a/MPF.Check/Features/MainFeature.cs b/MPF.Check/Features/MainFeature.cs index 5d71305c..485c5e2a 100644 --- a/MPF.Check/Features/MainFeature.cs +++ b/MPF.Check/Features/MainFeature.cs @@ -135,13 +135,13 @@ namespace MPF.Check.Features Options.Processing.ProtectionScanning.HideDriveLetters = false; // Redump Login Information - Options.Processing.Login.RetrieveMatchInformation = true; + Options.Processing.Login.PullAllInformation = false; Options.Processing.Login.RedumpUsername = null; Options.Processing.Login.RedumpPassword = null; + Options.Processing.Login.RetrieveMatchInformation = true; // Media Information Options.Processing.MediaInformation.AddPlaceholders = true; - Options.Processing.MediaInformation.PullAllInformation = false; // Post-Information Options Options.Processing.AddFilenameSuffix = false; @@ -211,7 +211,7 @@ namespace MPF.Check.Features // Pull all information (requires Redump login) else if (PullAllInput.ProcessInput(args, ref index)) - Options.Processing.MediaInformation.PullAllInformation = !Options.Processing.MediaInformation.PullAllInformation; + Options.Processing.Login.PullAllInformation = !Options.Processing.Login.PullAllInformation; // Use a device path for physical checks else if (PathInput.ProcessInput(args, ref index)) diff --git a/MPF.Frontend/Features/ListConfigFeature.cs b/MPF.Frontend/Features/ListConfigFeature.cs index becc7ef7..5e20789c 100644 --- a/MPF.Frontend/Features/ListConfigFeature.cs +++ b/MPF.Frontend/Features/ListConfigFeature.cs @@ -118,36 +118,36 @@ namespace MPF.Frontend.Features Console.WriteLine("Protection Scanning Options:"); Console.WriteLine($" Scan for Protection = {options.Processing.ProtectionScanning.ScanForProtection}"); Console.WriteLine($" Scan Archives for Protection = {options.Processing.ProtectionScanning.ScanArchivesForProtection}"); - Console.WriteLine($" Include Debug Protection Information = {options.Processing.ProtectionScanning.IncludeDebugProtectionInformation}"); Console.WriteLine($" Hide Drive Letters = {options.Processing.ProtectionScanning.HideDriveLetters}"); + Console.WriteLine($" Include Debug Protection Information = {options.Processing.ProtectionScanning.IncludeDebugProtectionInformation}"); Console.WriteLine(); // Redump Login Information Console.WriteLine("Redump Login Information:"); - Console.WriteLine($" Retrieve Match Information = {options.Processing.Login.RetrieveMatchInformation}"); + Console.WriteLine($" Pull All Information = {options.Processing.Login.PullAllInformation}"); 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(); // Media Information Console.WriteLine("Media Information:"); Console.WriteLine($" Add Placeholders = {options.Processing.MediaInformation.AddPlaceholders}"); - Console.WriteLine($" Prompt for Media Information = {options.Processing.MediaInformation.PromptForDiscInformation}"); - Console.WriteLine($" Pull All Information = {options.Processing.MediaInformation.PullAllInformation}"); - Console.WriteLine($" Enable Tabs in Input Fields = {options.Processing.MediaInformation.EnableTabsInInputFields}"); Console.WriteLine($" Enable Redump Compatibility = {options.Processing.MediaInformation.EnableRedumpCompatibility}"); + Console.WriteLine($" Enable Tabs in Input Fields = {options.Processing.MediaInformation.EnableTabsInInputFields}"); + Console.WriteLine($" Prompt for Media Information = {options.Processing.MediaInformation.PromptForDiscInformation}"); Console.WriteLine(); - // Output Options - Console.WriteLine("Output Options:"); - Console.WriteLine($" Show Disc Eject Reminder = {options.Processing.ShowDiscEjectReminder}"); + // Post-Information Options + Console.WriteLine("Post-Information Options:"); Console.WriteLine($" Add Filename Suffix = {options.Processing.AddFilenameSuffix}"); - Console.WriteLine($" Create IRD After Dumping = {options.Processing.CreateIRDAfterDumping}"); - Console.WriteLine($" Output Submission JSON = {options.Processing.OutputSubmissionJSON}"); - Console.WriteLine($" Include Artifacts = {options.Processing.IncludeArtifacts}"); Console.WriteLine($" Compress Log Files = {options.Processing.CompressLogFiles}"); - Console.WriteLine($" Log Compression = {options.Processing.LogCompression.LongName()}"); + Console.WriteLine($" Create IRD After Dumping = {options.Processing.CreateIRDAfterDumping}"); Console.WriteLine($" Delete Unnecessary Files = {options.Processing.DeleteUnnecessaryFiles}"); + Console.WriteLine($" Include Artifacts = {options.Processing.IncludeArtifacts}"); + Console.WriteLine($" Log Compression = {options.Processing.LogCompression.LongName()}"); + Console.WriteLine($" Output Submission JSON = {options.Processing.OutputSubmissionJSON}"); + Console.WriteLine($" Show Disc Eject Reminder = {options.Processing.ShowDiscEjectReminder}"); Console.WriteLine(); return true; diff --git a/MPF.Frontend/Options.cs b/MPF.Frontend/Options.cs index b97ddd0f..2ccacc8e 100644 --- a/MPF.Frontend/Options.cs +++ b/MPF.Frontend/Options.cs @@ -167,28 +167,28 @@ namespace MPF.Frontend Processing.ProtectionScanning.ScanForProtection = GetBooleanSetting(source, "ScanForProtection", true); Processing.ProtectionScanning.ScanArchivesForProtection = GetBooleanSetting(source, "ScanArchivesForProtection", true); - Processing.ProtectionScanning.IncludeDebugProtectionInformation = GetBooleanSetting(source, "IncludeDebugProtectionInformation", false); Processing.ProtectionScanning.HideDriveLetters = GetBooleanSetting(source, "HideDriveLetters", false); + Processing.ProtectionScanning.IncludeDebugProtectionInformation = GetBooleanSetting(source, "IncludeDebugProtectionInformation", false); - Processing.Login.RetrieveMatchInformation = GetBooleanSetting(source, "RetrieveMatchInformation", true); + Processing.Login.PullAllInformation = GetBooleanSetting(source, "PullAllInformation", false); Processing.Login.RedumpUsername = GetStringSetting(source, "RedumpUsername", string.Empty); Processing.Login.RedumpPassword = GetStringSetting(source, "RedumpPassword", string.Empty); + Processing.Login.RetrieveMatchInformation = GetBooleanSetting(source, "RetrieveMatchInformation", true); Processing.MediaInformation.AddPlaceholders = GetBooleanSetting(source, "AddPlaceholders", true); - Processing.MediaInformation.PromptForDiscInformation = GetBooleanSetting(source, "PromptForDiscInformation", true); - Processing.MediaInformation.PullAllInformation = GetBooleanSetting(source, "PullAllInformation", false); - Processing.MediaInformation.EnableTabsInInputFields = GetBooleanSetting(source, "EnableTabsInInputFields", true); Processing.MediaInformation.EnableRedumpCompatibility = GetBooleanSetting(source, "EnableRedumpCompatibility", true); + Processing.MediaInformation.EnableTabsInInputFields = GetBooleanSetting(source, "EnableTabsInInputFields", true); + Processing.MediaInformation.PromptForDiscInformation = GetBooleanSetting(source, "PromptForDiscInformation", true); - Processing.ShowDiscEjectReminder = GetBooleanSetting(source, "ShowDiscEjectReminder", true); Processing.AddFilenameSuffix = GetBooleanSetting(source, "AddFilenameSuffix", false); - Processing.CreateIRDAfterDumping = GetBooleanSetting(source, "CreateIRDAfterDumping", false); - Processing.OutputSubmissionJSON = GetBooleanSetting(source, "OutputSubmissionJSON", false); - Processing.IncludeArtifacts = GetBooleanSetting(source, "IncludeArtifacts", false); Processing.CompressLogFiles = GetBooleanSetting(source, "CompressLogFiles", true); + Processing.CreateIRDAfterDumping = GetBooleanSetting(source, "CreateIRDAfterDumping", false); + Processing.DeleteUnnecessaryFiles = GetBooleanSetting(source, "DeleteUnnecessaryFiles", false); + Processing.IncludeArtifacts = GetBooleanSetting(source, "IncludeArtifacts", false); valueString = GetStringSetting(source, "LogCompression", LogCompression.DeflateMaximum.ToString()); Processing.LogCompression = valueString.ToLogCompression(); - Processing.DeleteUnnecessaryFiles = GetBooleanSetting(source, "DeleteUnnecessaryFiles", false); + Processing.OutputSubmissionJSON = GetBooleanSetting(source, "OutputSubmissionJSON", false); + Processing.ShowDiscEjectReminder = GetBooleanSetting(source, "ShowDiscEjectReminder", true); } /// @@ -261,27 +261,27 @@ namespace MPF.Frontend Processing.ProtectionScanning.ScanForProtection = source.Processing.ProtectionScanning.ScanForProtection; Processing.ProtectionScanning.ScanArchivesForProtection = source.Processing.ProtectionScanning.ScanArchivesForProtection; - Processing.ProtectionScanning.IncludeDebugProtectionInformation = source.Processing.ProtectionScanning.IncludeDebugProtectionInformation; Processing.ProtectionScanning.HideDriveLetters = source.Processing.ProtectionScanning.HideDriveLetters; + Processing.ProtectionScanning.IncludeDebugProtectionInformation = source.Processing.ProtectionScanning.IncludeDebugProtectionInformation; - Processing.Login.RetrieveMatchInformation = source.Processing.Login.RetrieveMatchInformation; + Processing.Login.PullAllInformation = source.Processing.Login.PullAllInformation; Processing.Login.RedumpUsername = source.Processing.Login.RedumpUsername; Processing.Login.RedumpPassword = source.Processing.Login.RedumpPassword; + Processing.Login.RetrieveMatchInformation = source.Processing.Login.RetrieveMatchInformation; Processing.MediaInformation.AddPlaceholders = source.Processing.MediaInformation.AddPlaceholders; - Processing.MediaInformation.PromptForDiscInformation = source.Processing.MediaInformation.PromptForDiscInformation; - Processing.MediaInformation.PullAllInformation = source.Processing.MediaInformation.PullAllInformation; - Processing.MediaInformation.EnableTabsInInputFields = source.Processing.MediaInformation.EnableTabsInInputFields; Processing.MediaInformation.EnableRedumpCompatibility = source.Processing.MediaInformation.EnableRedumpCompatibility; + Processing.MediaInformation.EnableTabsInInputFields = source.Processing.MediaInformation.EnableTabsInInputFields; + Processing.MediaInformation.PromptForDiscInformation = source.Processing.MediaInformation.PromptForDiscInformation; - Processing.ShowDiscEjectReminder = source.Processing.ShowDiscEjectReminder; Processing.AddFilenameSuffix = source.Processing.AddFilenameSuffix; - Processing.CreateIRDAfterDumping = source.Processing.CreateIRDAfterDumping; - Processing.OutputSubmissionJSON = source.Processing.OutputSubmissionJSON; - Processing.IncludeArtifacts = source.Processing.IncludeArtifacts; Processing.CompressLogFiles = source.Processing.CompressLogFiles; - Processing.LogCompression = source.Processing.LogCompression; + Processing.CreateIRDAfterDumping = source.Processing.CreateIRDAfterDumping; Processing.DeleteUnnecessaryFiles = source.Processing.DeleteUnnecessaryFiles; + Processing.IncludeArtifacts = source.Processing.IncludeArtifacts; + Processing.LogCompression = source.Processing.LogCompression; + Processing.OutputSubmissionJSON = source.Processing.OutputSubmissionJSON; + Processing.ShowDiscEjectReminder = source.Processing.ShowDiscEjectReminder; } #endregion @@ -350,7 +350,7 @@ namespace MPF.Frontend { "ScanForProtection", Processing.ProtectionScanning.ScanForProtection.ToString() }, { "AddPlaceholders", Processing.MediaInformation.AddPlaceholders.ToString() }, { "PromptForDiscInformation", Processing.MediaInformation.PromptForDiscInformation.ToString() }, - { "PullAllInformation", Processing.MediaInformation.PullAllInformation.ToString() }, + { "PullAllInformation", Processing.Login.PullAllInformation.ToString() }, { "EnableTabsInInputFields", Processing.MediaInformation.EnableTabsInInputFields.ToString() }, { "EnableRedumpCompatibility", Processing.MediaInformation.EnableRedumpCompatibility.ToString() }, { "ShowDiscEjectReminder", Processing.ShowDiscEjectReminder.ToString() }, @@ -774,16 +774,10 @@ namespace MPF.Frontend public bool AddPlaceholders { get; set; } = true; /// - /// Show the media information window after dumping + /// Limit outputs to Redump-supported values only /// /// Version 1 and greater - public bool PromptForDiscInformation { get; set; } = true; - - /// - /// Pull all information from Redump if signed in - /// - /// Version 1 and greater - public bool PullAllInformation { get; set; } = false; + public bool EnableRedumpCompatibility { get; set; } = true; /// /// Enable tabs in all input fields @@ -792,10 +786,10 @@ namespace MPF.Frontend public bool EnableTabsInInputFields { get; set; } = true; /// - /// Limit outputs to Redump-supported values only + /// Show the media information window after dumping /// /// Version 1 and greater - public bool EnableRedumpCompatibility { get; set; } = true; + public bool PromptForDiscInformation { get; set; } = true; } /// @@ -833,13 +827,7 @@ namespace MPF.Frontend #endregion - #region Output - - /// - /// Show disc eject reminder before the media information window is shown - /// - /// Version 1 and greater - public bool ShowDiscEjectReminder { get; set; } = true; + #region Post-Information /// /// Add the dump filename as a suffix to the auto-generated files @@ -847,6 +835,12 @@ namespace MPF.Frontend /// Version 1 and greater public bool AddFilenameSuffix { get; set; } = false; + /// + /// Compress output log files to reduce space + /// + /// Version 1 and greater + public bool CompressLogFiles { get; set; } = true; + /// /// Create a PS3 IRD file after dumping PS3 BD-ROM discs /// @@ -854,10 +848,10 @@ namespace MPF.Frontend public bool CreateIRDAfterDumping { get; set; } = false; /// - /// Output the compressed JSON version of the submission info + /// Delete unnecessary files to reduce space /// /// Version 1 and greater - public bool OutputSubmissionJSON { get; set; } = false; + public bool DeleteUnnecessaryFiles { get; set; } = false; /// /// Include log files in serialized JSON data @@ -865,12 +859,6 @@ namespace MPF.Frontend /// Version 1 and greater public bool IncludeArtifacts { get; set; } = false; - /// - /// Compress output log files to reduce space - /// - /// Version 1 and greater - public bool CompressLogFiles { get; set; } = true; - /// /// Compression type used during log compression /// @@ -878,10 +866,16 @@ namespace MPF.Frontend public LogCompression LogCompression { get; set; } = LogCompression.DeflateMaximum; /// - /// Delete unnecessary files to reduce space + /// Output the compressed JSON version of the submission info /// /// Version 1 and greater - public bool DeleteUnnecessaryFiles { get; set; } = false; + public bool OutputSubmissionJSON { get; set; } = false; + + /// + /// Show disc eject reminder before the media information window is shown + /// + /// Version 1 and greater + public bool ShowDiscEjectReminder { get; set; } = true; #endregion } @@ -903,17 +897,17 @@ namespace MPF.Frontend /// Version 1 and greater public bool ScanArchivesForProtection { get; set; } = true; - /// - /// Include debug information with scan results - /// - /// Version 1 and greater - public bool IncludeDebugProtectionInformation { get; set; } = false; - /// /// Remove drive letters from protection scan output /// /// Version 1 and greater public bool HideDriveLetters { get; set; } = false; + + /// + /// Include debug information with scan results + /// + /// Version 1 and greater + public bool IncludeDebugProtectionInformation { get; set; } = false; } /// @@ -921,18 +915,30 @@ namespace MPF.Frontend /// public class SiteLoginSettings { + /// + /// Pull all information from Redump if signed in + /// + /// Version 1 and greater + public bool PullAllInformation { get; set; } = false; + + /// + /// Username for Redump, requires + /// + /// Version 1 and greater + public string? RedumpUsername { get; set; } = string.Empty; + + /// + /// Password for Redump, requires + /// + /// Version 1 and greater + // TODO: Figure out a way to keep this encrypted in some way, BASE64 to start? + public string? RedumpPassword { get; set; } = string.Empty; + /// /// Enable retrieving match information from Redump /// /// Version 1 and greater public bool RetrieveMatchInformation { get; set; } = true; - - /// Version 1 and greater - public string? RedumpUsername { get; set; } = string.Empty; - - /// Version 1 and greater - // TODO: Figure out a way to keep this encrypted in some way, BASE64 to start? - public string? RedumpPassword { get; set; } = string.Empty; } /// diff --git a/MPF.Frontend/Tools/SubmissionGenerator.cs b/MPF.Frontend/Tools/SubmissionGenerator.cs index 7be264a5..67894d32 100644 --- a/MPF.Frontend/Tools/SubmissionGenerator.cs +++ b/MPF.Frontend/Tools/SubmissionGenerator.cs @@ -350,7 +350,7 @@ namespace MPF.Frontend.Tools // Fill in the fields from the existing ID resultProgress?.Report(ResultEventArgs.Neutral($"Filling fields from existing ID {fullyMatchedIdsList[i]}...")); - _ = await Builder.FillFromId(wc, info, fullyMatchedIdsList[i], options.Processing.MediaInformation.PullAllInformation); + _ = await Builder.FillFromId(wc, info, fullyMatchedIdsList[i], options.Processing.Login.PullAllInformation); resultProgress?.Report(ResultEventArgs.Success("Information filling complete!")); // Set the fully matched ID to the current