From 1a9d38dd0ec0b84e282b3ea0e42bbb3806d5b7e2 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 6 Oct 2022 11:11:23 -0700 Subject: [PATCH] Add dumping info section skeleton --- MPF.Library/InfoTool.cs | 5 ++++- MPF.Modules/DD/Parameters.cs | 2 +- MPF.Modules/DiscImageCreator/Parameters.cs | 2 +- MPF.Modules/Redumper/Parameters.cs | 2 +- MPF.Modules/UmdImageCreator/Parameters.cs | 2 +- MPF.Test/RedumpLib/SubmissionInfoTests.cs | 6 +++++- MPF/ViewModels/MainViewModel.cs | 6 +++++- RedumpLib/Data/SubmissionInfo.cs | 14 +++++++------- 8 files changed, 25 insertions(+), 14 deletions(-) diff --git a/MPF.Library/InfoTool.cs b/MPF.Library/InfoTool.cs index 0d897f10..9a6ee319 100644 --- a/MPF.Library/InfoTool.cs +++ b/MPF.Library/InfoTool.cs @@ -660,7 +660,6 @@ namespace MPF.Library info.SizeAndChecksums.Layerbreak2, info.SizeAndChecksums.Layerbreak3), 1); - AddIfExists(output, Template.DumpingProgramField, info.CommonDiscInfo.DumpingProgram, 1); AddIfExists(output, Template.CategoryField, info.CommonDiscInfo.Category.LongName(), 1); AddIfExists(output, Template.FullyMatchingIDField, info.FullyMatchedID?.ToString(), 1); AddIfExists(output, Template.PartiallyMatchingIDsField, info.PartiallyMatchedIDs, 1); @@ -751,6 +750,10 @@ namespace MPF.Library AddIfExists(output, Template.CommentsField, info.CommonDiscInfo.Comments.Trim(), 1); AddIfExists(output, Template.ContentsField, info.CommonDiscInfo.Contents.Trim(), 1); + // Dumping Info section + output.Add(""); output.Add("Dumping Info:"); + AddIfExists(output, Template.DumpingProgramField, info.DumpingInfo.DumpingProgram, 1); + // Version and Editions section output.Add(""); output.Add("Version and Editions:"); AddIfExists(output, Template.VersionField, info.VersionAndEditions.Version, 1); diff --git a/MPF.Modules/DD/Parameters.cs b/MPF.Modules/DD/Parameters.cs index 989148b2..1e1a119a 100644 --- a/MPF.Modules/DD/Parameters.cs +++ b/MPF.Modules/DD/Parameters.cs @@ -82,7 +82,7 @@ namespace MPF.Modules.DD string outputDirectory = Path.GetDirectoryName(basePath); // TODO: Determine if there's a DD version anywhere - info.CommonDiscInfo.DumpingProgram = EnumConverter.LongName(this.InternalProgram); + info.DumpingInfo.DumpingProgram = EnumConverter.LongName(this.InternalProgram); switch (this.Type) { diff --git a/MPF.Modules/DiscImageCreator/Parameters.cs b/MPF.Modules/DiscImageCreator/Parameters.cs index 2f602fe5..dcc0d2ef 100644 --- a/MPF.Modules/DiscImageCreator/Parameters.cs +++ b/MPF.Modules/DiscImageCreator/Parameters.cs @@ -377,7 +377,7 @@ namespace MPF.Modules.DiscImageCreator // Get the dumping program and version (_, string dicVersion) = GetCommandFilePathAndVersion(basePath); - info.CommonDiscInfo.DumpingProgram = $"{EnumConverter.LongName(this.InternalProgram)} {dicVersion ?? "Unknown Version"}"; + info.DumpingInfo.DumpingProgram = $"{EnumConverter.LongName(this.InternalProgram)} {dicVersion ?? "Unknown Version"}"; // Fill in the hash data info.TracksAndWriteOffsets.ClrMameProData = GetDatfile($"{basePath}.dat"); diff --git a/MPF.Modules/Redumper/Parameters.cs b/MPF.Modules/Redumper/Parameters.cs index 308e1326..3425af15 100644 --- a/MPF.Modules/Redumper/Parameters.cs +++ b/MPF.Modules/Redumper/Parameters.cs @@ -130,7 +130,7 @@ namespace MPF.Modules.Redumper string outputDirectory = Path.GetDirectoryName(basePath); // TODO: Determine if there's a Redumper version anywhere - info.CommonDiscInfo.DumpingProgram = EnumConverter.LongName(this.InternalProgram); + info.DumpingInfo.DumpingProgram = EnumConverter.LongName(this.InternalProgram); switch (this.Type) { diff --git a/MPF.Modules/UmdImageCreator/Parameters.cs b/MPF.Modules/UmdImageCreator/Parameters.cs index 8506d972..83b8fae7 100644 --- a/MPF.Modules/UmdImageCreator/Parameters.cs +++ b/MPF.Modules/UmdImageCreator/Parameters.cs @@ -65,7 +65,7 @@ namespace MPF.Modules.UmdImageCreator public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, Drive drive, bool includeArtifacts) { // TODO: Determine if there's a UMDImageCreator version anywhere - info.CommonDiscInfo.DumpingProgram = EnumConverter.LongName(this.InternalProgram); + info.DumpingInfo.DumpingProgram = EnumConverter.LongName(this.InternalProgram); // Extract info based generically on MediaType switch (this.Type) diff --git a/MPF.Test/RedumpLib/SubmissionInfoTests.cs b/MPF.Test/RedumpLib/SubmissionInfoTests.cs index fcb3ea44..a189d8fa 100644 --- a/MPF.Test/RedumpLib/SubmissionInfoTests.cs +++ b/MPF.Test/RedumpLib/SubmissionInfoTests.cs @@ -51,7 +51,6 @@ namespace MPF.Test.RedumpLib { System = RedumpSystem.IBMPCcompatible, Media = DiscType.CD, - DumpingProgram = "DiscImageCreator 20500101", Title = "Game Title", ForeignTitleNonLatin = "Foreign Game Title", DiscNumberLetter = "1", @@ -93,6 +92,11 @@ namespace MPF.Test.RedumpLib }, }, + DumpingInfo = new DumpingInfoSection() + { + DumpingProgram = "DiscImageCreator 20500101", + }, + VersionAndEditions = new VersionAndEditionsSection() { Version = "Original", diff --git a/MPF/ViewModels/MainViewModel.cs b/MPF/ViewModels/MainViewModel.cs index 5cc29316..15440a5b 100644 --- a/MPF/ViewModels/MainViewModel.cs +++ b/MPF/ViewModels/MainViewModel.cs @@ -293,7 +293,6 @@ namespace MPF.UI.ViewModels { System = RedumpSystem.IBMPCcompatible, Media = DiscType.BD128, - DumpingProgram = "DiscImageCreator 20500101", Title = "Game Title", ForeignTitleNonLatin = "Foreign Game Title", DiscNumberLetter = "1", @@ -335,6 +334,11 @@ namespace MPF.UI.ViewModels }, }, + DumpingInfo = new DumpingInfoSection() + { + DumpingProgram = "DiscImageCreator 20500101", + }, + VersionAndEditions = new VersionAndEditionsSection() { Version = "Original", diff --git a/RedumpLib/Data/SubmissionInfo.cs b/RedumpLib/Data/SubmissionInfo.cs index 1f1ea4ca..95b3c1ed 100644 --- a/RedumpLib/Data/SubmissionInfo.cs +++ b/RedumpLib/Data/SubmissionInfo.cs @@ -81,6 +81,7 @@ namespace RedumpLib.Data Added = this.Added, LastModified = this.LastModified, CommonDiscInfo = this.CommonDiscInfo?.Clone() as CommonDiscInfoSection, + DumpingInfo = this.DumpingInfo?.Clone() as DumpingInfoSection, VersionAndEditions = this.VersionAndEditions?.Clone() as VersionAndEditionsSection, EDC = this.EDC?.Clone() as EDCSection, ParentCloneRelationship = this.ParentCloneRelationship?.Clone() as ParentCloneRelationshipSection, @@ -109,10 +110,6 @@ namespace RedumpLib.Data [JsonConverter(typeof(DiscTypeConverter))] public DiscType? Media { get; set; } - // Name not defined by Redump - [JsonProperty(PropertyName = "d_dumping_program", Required = Required.AllowNull)] - public string DumpingProgram { get; set; } - [JsonProperty(PropertyName = "d_title", Required = Required.AllowNull)] public string Title { get; set; } @@ -240,7 +237,6 @@ namespace RedumpLib.Data { System = this.System, Media = this.Media, - DumpingProgram = this.DumpingProgram, Title = this.Title, ForeignTitleNonLatin = this.ForeignTitleNonLatin, DiscNumberLetter = this.DiscNumberLetter, @@ -287,13 +283,17 @@ namespace RedumpLib.Data /// public class DumpingInfoSection : ICloneable { - // TODO: Add properties here + // Name not defined by Redump + [JsonProperty(PropertyName = "d_dumping_program", Required = Required.AllowNull)] + public string DumpingProgram { get; set; } + + // TODO: Add dumping hardware properties here public object Clone() { return new DumpingInfoSection { - // TODO: Add properties here + DumpingProgram = this.DumpingProgram, }; } }