mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Make SourceDetails more complete
This commit is contained in:
@@ -188,6 +188,8 @@ namespace SabreTools.Data.Extensions
|
||||
return softwareList.Clone() as SoftwareList;
|
||||
else if (self is Sound sound)
|
||||
return sound.Clone() as Sound;
|
||||
else if (self is SourceDetails sourceDetails)
|
||||
return sourceDetails.Clone() as SourceDetails;
|
||||
else if (self is Video video)
|
||||
return video.Clone() as Video;
|
||||
|
||||
@@ -1867,10 +1869,10 @@ namespace SabreTools.Data.Extensions
|
||||
{
|
||||
return value switch
|
||||
{
|
||||
Width.Byte =>"8",
|
||||
Width.Short =>"16",
|
||||
Width.Int =>"32",
|
||||
Width.Long =>"64",
|
||||
Width.Byte => "8",
|
||||
Width.Short => "16",
|
||||
Width.Int => "32",
|
||||
Width.Long => "64",
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,87 +1,222 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SabreTools.Data.Models.Metadata
|
||||
{
|
||||
[JsonObject("source_details"), XmlRoot("source_details")]
|
||||
public class SourceDetails : DatItem
|
||||
public class SourceDetails : DatItem, ICloneable, IEquatable<SourceDetails>
|
||||
{
|
||||
#region Keys
|
||||
#region Properties
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string IdKey = "id";
|
||||
public string? AppendToNumber { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string AppendToNumberKey = "appendtonumber";
|
||||
public string? Comment1 { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string SectionKey = "section";
|
||||
public string? Comment2 { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string RomInfoKey = "rominfo";
|
||||
public string? DumpDate { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string DumpDateKey = "dumpdate";
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
public bool? DumpDateInfo { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
public const string DumpDateInfoKey = "dumpdateinfo";
|
||||
public string? Dumper { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ReleaseDateKey = "releasedate";
|
||||
public string? Id { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
public const string ReleaseDateInfoKey = "releasedateinfo";
|
||||
public string? Link1 { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string DumperKey = "dumper";
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
public bool? Link1Public { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ProjectKey = "project";
|
||||
public string? Link2 { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string OriginalFormatKey = "originalformat";
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
public bool? Link2Public { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
public const string NodumpKey = "nodump";
|
||||
public string? Link3 { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string ToolKey = "tool";
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
public bool? Link3Public { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string OriginKey = "origin";
|
||||
public string? MediaTitle { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string Comment1Key = "comment1";
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
public bool? Nodump { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string Comment2Key = "comment2";
|
||||
public string? Origin { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string Link1Key = "link1";
|
||||
public string? OriginalFormat { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
public const string Link1PublicKey = "link1public";
|
||||
public string? Project { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string Link2Key = "link2";
|
||||
public string? Region { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
public const string Link2PublicKey = "link2public";
|
||||
public string? ReleaseDate { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string Link3Key = "link3";
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
public bool? ReleaseDateInfo { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
public const string Link3PublicKey = "link3public";
|
||||
public string? RomInfo { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string RegionKey = "region";
|
||||
public string? Section { get; set; }
|
||||
|
||||
/// <remarks>string</remarks>
|
||||
public const string MediaTitleKey = "mediatitle";
|
||||
public string? Tool { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public SourceDetails() => ItemType = ItemType.SourceDetails;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object Clone()
|
||||
{
|
||||
var obj = new SourceDetails();
|
||||
|
||||
obj.AppendToNumber = AppendToNumber;
|
||||
obj.Comment1 = Comment1;
|
||||
obj.Comment2 = Comment2;
|
||||
obj.DumpDate = DumpDate;
|
||||
obj.DumpDateInfo = DumpDateInfo;
|
||||
obj.Dumper = Dumper;
|
||||
obj.Id = Id;
|
||||
obj.Link1 = Link1;
|
||||
obj.Link1Public = Link1Public;
|
||||
obj.Link2 = Link2;
|
||||
obj.Link2Public = Link2Public;
|
||||
obj.Link3 = Link3;
|
||||
obj.Link3Public = Link3Public;
|
||||
obj.MediaTitle = MediaTitle;
|
||||
obj.Nodump = Nodump;
|
||||
obj.Origin = Origin;
|
||||
obj.OriginalFormat = OriginalFormat;
|
||||
obj.Project = Project;
|
||||
obj.Region = Region;
|
||||
obj.ReleaseDate = ReleaseDate;
|
||||
obj.ReleaseDateInfo = ReleaseDateInfo;
|
||||
obj.RomInfo = RomInfo;
|
||||
obj.Section = Section;
|
||||
obj.Tool = Tool;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(SourceDetails? other)
|
||||
{
|
||||
// Null never matches
|
||||
if (other is null)
|
||||
return false;
|
||||
|
||||
// Properties
|
||||
if ((AppendToNumber is null) ^ (other.AppendToNumber is null))
|
||||
return false;
|
||||
else if (AppendToNumber is not null && !AppendToNumber.Equals(other.AppendToNumber, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Comment1 is null) ^ (other.Comment1 is null))
|
||||
return false;
|
||||
else if (Comment1 is not null && !Comment1.Equals(other.Comment1, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Comment2 is null) ^ (other.Comment2 is null))
|
||||
return false;
|
||||
else if (Comment2 is not null && !Comment2.Equals(other.Comment2, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((DumpDate is null) ^ (other.DumpDate is null))
|
||||
return false;
|
||||
else if (DumpDate is not null && !DumpDate.Equals(other.DumpDate, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (DumpDateInfo != other.DumpDateInfo)
|
||||
return false;
|
||||
|
||||
if ((Dumper is null) ^ (other.Dumper is null))
|
||||
return false;
|
||||
else if (Dumper is not null && !Dumper.Equals(other.Dumper, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Id is null) ^ (other.Id is null))
|
||||
return false;
|
||||
else if (Id is not null && !Id.Equals(other.Id, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Link1 is null) ^ (other.Link1 is null))
|
||||
return false;
|
||||
else if (Link1 is not null && !Link1.Equals(other.Link1, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (Link1Public != other.Link1Public)
|
||||
return false;
|
||||
|
||||
if ((Link2 is null) ^ (other.Link2 is null))
|
||||
return false;
|
||||
else if (Link2 is not null && !Link2.Equals(other.Link2, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (Link2Public != other.Link2Public)
|
||||
return false;
|
||||
|
||||
if ((Link3 is null) ^ (other.Link3 is null))
|
||||
return false;
|
||||
else if (Link3 is not null && !Link3.Equals(other.Link3, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (Link3Public != other.Link3Public)
|
||||
return false;
|
||||
|
||||
if ((MediaTitle is null) ^ (other.MediaTitle is null))
|
||||
return false;
|
||||
else if (MediaTitle is not null && !MediaTitle.Equals(other.MediaTitle, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (Nodump != other.Nodump)
|
||||
return false;
|
||||
|
||||
if ((Origin is null) ^ (other.Origin is null))
|
||||
return false;
|
||||
else if (Origin is not null && !Origin.Equals(other.Origin, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((OriginalFormat is null) ^ (other.OriginalFormat is null))
|
||||
return false;
|
||||
else if (OriginalFormat is not null && !OriginalFormat.Equals(other.OriginalFormat, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Project is null) ^ (other.Project is null))
|
||||
return false;
|
||||
else if (Project is not null && !Project.Equals(other.Project, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Region is null) ^ (other.Region is null))
|
||||
return false;
|
||||
else if (Region is not null && !Region.Equals(other.Region, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((ReleaseDate is null) ^ (other.ReleaseDate is null))
|
||||
return false;
|
||||
else if (ReleaseDate is not null && !ReleaseDate.Equals(other.ReleaseDate, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if (ReleaseDateInfo != other.ReleaseDateInfo)
|
||||
return false;
|
||||
|
||||
if ((RomInfo is null) ^ (other.RomInfo is null))
|
||||
return false;
|
||||
else if (RomInfo is not null && !RomInfo.Equals(other.RomInfo, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Section is null) ^ (other.Section is null))
|
||||
return false;
|
||||
else if (Section is not null && !Section.Equals(other.Section, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
if ((Tool is null) ^ (other.Tool is null))
|
||||
return false;
|
||||
else if (Tool is not null && !Tool.Equals(other.Tool, StringComparison.OrdinalIgnoreCase))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,16 +21,16 @@ namespace SabreTools.Data.Models.NoIntroDatabase
|
||||
[XmlAttribute("d_date")]
|
||||
public string? DumpDate { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
[XmlAttribute("d_date_info")]
|
||||
public string? DumpDateInfo { get; set; }
|
||||
public bool? DumpDateInfo { get; set; }
|
||||
|
||||
[XmlAttribute("r_date")]
|
||||
public string? ReleaseDate { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
[XmlAttribute("r_date_info")]
|
||||
public string? ReleaseDateInfo { get; set; }
|
||||
public bool? ReleaseDateInfo { get; set; }
|
||||
|
||||
[XmlAttribute("dumper")]
|
||||
public string? Dumper { get; set; }
|
||||
@@ -41,9 +41,9 @@ namespace SabreTools.Data.Models.NoIntroDatabase
|
||||
[XmlAttribute("originalformat")]
|
||||
public string? OriginalFormat { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
[XmlAttribute("nodump")]
|
||||
public string? Nodump { get; set; }
|
||||
public bool? Nodump { get; set; }
|
||||
|
||||
[XmlAttribute("tool")]
|
||||
public string? Tool { get; set; }
|
||||
@@ -60,23 +60,23 @@ namespace SabreTools.Data.Models.NoIntroDatabase
|
||||
[XmlAttribute("link1")]
|
||||
public string? Link1 { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
[XmlAttribute("link1_public")]
|
||||
public string? Link1Public { get; set; }
|
||||
public bool? Link1Public { get; set; }
|
||||
|
||||
[XmlAttribute("link2")]
|
||||
public string? Link2 { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
[XmlAttribute("link2_public")]
|
||||
public string? Link2Public { get; set; }
|
||||
public bool? Link2Public { get; set; }
|
||||
|
||||
[XmlAttribute("link3")]
|
||||
public string? Link3 { get; set; }
|
||||
|
||||
/// <remarks>byte</remarks>
|
||||
/// <remarks>(0|1) "0"</remarks>
|
||||
[XmlAttribute("link3_public")]
|
||||
public string? Link3Public { get; set; }
|
||||
public bool? Link3Public { get; set; }
|
||||
|
||||
[XmlAttribute("region")]
|
||||
public string? Region { get; set; }
|
||||
|
||||
@@ -951,30 +951,30 @@ namespace SabreTools.Metadata.DatFiles.Test
|
||||
{
|
||||
return new Data.Models.Metadata.SourceDetails
|
||||
{
|
||||
[Data.Models.Metadata.SourceDetails.IdKey] = "id",
|
||||
[Data.Models.Metadata.SourceDetails.AppendToNumberKey] = "appendtonumber",
|
||||
[Data.Models.Metadata.SourceDetails.SectionKey] = "section",
|
||||
[Data.Models.Metadata.SourceDetails.RomInfoKey] = "rominfo",
|
||||
[Data.Models.Metadata.SourceDetails.DumpDateKey] = "dumpdate",
|
||||
[Data.Models.Metadata.SourceDetails.DumpDateInfoKey] = "dumpdateinfo",
|
||||
[Data.Models.Metadata.SourceDetails.ReleaseDateKey] = "releasedate",
|
||||
[Data.Models.Metadata.SourceDetails.ReleaseDateInfoKey] = "releasedateinfo",
|
||||
[Data.Models.Metadata.SourceDetails.DumperKey] = "dumper",
|
||||
[Data.Models.Metadata.SourceDetails.ProjectKey] = "project",
|
||||
[Data.Models.Metadata.SourceDetails.OriginalFormatKey] = "originalformat",
|
||||
[Data.Models.Metadata.SourceDetails.NodumpKey] = "nodump",
|
||||
[Data.Models.Metadata.SourceDetails.ToolKey] = "tool",
|
||||
[Data.Models.Metadata.SourceDetails.OriginKey] = "origin",
|
||||
[Data.Models.Metadata.SourceDetails.Comment1Key] = "comment1",
|
||||
[Data.Models.Metadata.SourceDetails.Comment2Key] = "comment2",
|
||||
[Data.Models.Metadata.SourceDetails.Link1Key] = "link1",
|
||||
[Data.Models.Metadata.SourceDetails.Link1PublicKey] = "link1public",
|
||||
[Data.Models.Metadata.SourceDetails.Link2Key] = "link2",
|
||||
[Data.Models.Metadata.SourceDetails.Link2PublicKey] = "link2public",
|
||||
[Data.Models.Metadata.SourceDetails.Link3Key] = "link3",
|
||||
[Data.Models.Metadata.SourceDetails.Link3PublicKey] = "link3public",
|
||||
[Data.Models.Metadata.SourceDetails.RegionKey] = "region",
|
||||
[Data.Models.Metadata.SourceDetails.MediaTitleKey] = "mediatitle",
|
||||
AppendToNumber = "appendtonumber",
|
||||
Comment1 = "comment1",
|
||||
Comment2 = "comment2",
|
||||
DumpDate = "dumpdate",
|
||||
DumpDateInfo = true,
|
||||
Dumper = "dumper",
|
||||
Id = "id",
|
||||
Link1 = "link1",
|
||||
Link1Public = true,
|
||||
Link2 = "link2",
|
||||
Link2Public = true,
|
||||
Link3 = "link3",
|
||||
Link3Public = true,
|
||||
MediaTitle = "mediatitle",
|
||||
Nodump = true,
|
||||
Origin = "origin",
|
||||
OriginalFormat = "originalformat",
|
||||
Project = "project",
|
||||
Region = "region",
|
||||
ReleaseDate = "releasedate",
|
||||
ReleaseDateInfo = true,
|
||||
RomInfo = "rominfo",
|
||||
Section = "section",
|
||||
Tool = "tool",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1204,30 +1204,30 @@ namespace SabreTools.Metadata.DatFiles.Test
|
||||
private static void ValidateMetadataSourceDetails(Data.Models.Metadata.SourceDetails? sourceDetails)
|
||||
{
|
||||
Assert.NotNull(sourceDetails);
|
||||
Assert.Equal("id", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.IdKey));
|
||||
Assert.Equal("appendtonumber", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.AppendToNumberKey));
|
||||
Assert.Equal("section", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.SectionKey));
|
||||
Assert.Equal("rominfo", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.RomInfoKey));
|
||||
Assert.Equal("dumpdate", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.DumpDateKey));
|
||||
Assert.Equal("dumpdateinfo", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.DumpDateInfoKey));
|
||||
Assert.Equal("releasedate", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.ReleaseDateKey));
|
||||
Assert.Equal("releasedateinfo", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.ReleaseDateInfoKey));
|
||||
Assert.Equal("dumper", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.DumperKey));
|
||||
Assert.Equal("project", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.ProjectKey));
|
||||
Assert.Equal("originalformat", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.OriginalFormatKey));
|
||||
Assert.Equal("nodump", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.NodumpKey));
|
||||
Assert.Equal("tool", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.ToolKey));
|
||||
Assert.Equal("origin", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.OriginKey));
|
||||
Assert.Equal("comment1", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.Comment1Key));
|
||||
Assert.Equal("comment2", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.Comment2Key));
|
||||
Assert.Equal("link1", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.Link1Key));
|
||||
Assert.Equal("link1public", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.Link1PublicKey));
|
||||
Assert.Equal("link2", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.Link2Key));
|
||||
Assert.Equal("link2public", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.Link2PublicKey));
|
||||
Assert.Equal("link3", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.Link3Key));
|
||||
Assert.Equal("link3public", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.Link3PublicKey));
|
||||
Assert.Equal("region", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.RegionKey));
|
||||
Assert.Equal("mediatitle", sourceDetails.ReadString(Data.Models.Metadata.SourceDetails.MediaTitleKey));
|
||||
Assert.Equal("appendtonumber", sourceDetails.AppendToNumber);
|
||||
Assert.Equal("comment1", sourceDetails.Comment1);
|
||||
Assert.Equal("comment2", sourceDetails.Comment2);
|
||||
Assert.Equal("dumpdate", sourceDetails.DumpDate);
|
||||
Assert.Equal(true, sourceDetails.DumpDateInfo);
|
||||
Assert.Equal("dumper", sourceDetails.Dumper);
|
||||
Assert.Equal("id", sourceDetails.Id);
|
||||
Assert.Equal("link1", sourceDetails.Link1);
|
||||
Assert.Equal(true, sourceDetails.Link1Public);
|
||||
Assert.Equal("link2", sourceDetails.Link2);
|
||||
Assert.Equal(true, sourceDetails.Link2Public);
|
||||
Assert.Equal("link3", sourceDetails.Link3);
|
||||
Assert.Equal(true, sourceDetails.Link3Public);
|
||||
Assert.Equal("mediatitle", sourceDetails.MediaTitle);
|
||||
Assert.Equal(true, sourceDetails.Nodump);
|
||||
Assert.Equal("origin", sourceDetails.Origin);
|
||||
Assert.Equal("originalformat", sourceDetails.OriginalFormat);
|
||||
Assert.Equal("project", sourceDetails.Project);
|
||||
Assert.Equal("region", sourceDetails.Region);
|
||||
Assert.Equal("releasedate", sourceDetails.ReleaseDate);
|
||||
Assert.Equal(true, sourceDetails.ReleaseDateInfo);
|
||||
Assert.Equal("rominfo", sourceDetails.RomInfo);
|
||||
Assert.Equal("section", sourceDetails.Section);
|
||||
Assert.Equal("tool", sourceDetails.Tool);
|
||||
}
|
||||
|
||||
private static void ValidateMetadataTrurip(Data.Models.Logiqx.Trurip? trurip)
|
||||
|
||||
@@ -12,10 +12,154 @@ namespace SabreTools.Metadata.DatItems.Formats
|
||||
{
|
||||
#region Fields
|
||||
|
||||
public string? AppendToNumber
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.AppendToNumber;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.AppendToNumber = value;
|
||||
}
|
||||
|
||||
public string? Comment1
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Comment1;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Comment1 = value;
|
||||
}
|
||||
|
||||
public string? Comment2
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Comment2;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Comment2 = value;
|
||||
}
|
||||
|
||||
public string? DumpDate
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.DumpDate;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.DumpDate = value;
|
||||
}
|
||||
|
||||
public bool? DumpDateInfo
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.DumpDateInfo;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.DumpDateInfo = value;
|
||||
}
|
||||
|
||||
public string? Dumper
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Dumper;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Dumper = value;
|
||||
}
|
||||
|
||||
public string? Id
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Id;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Id = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc>/>
|
||||
public override Data.Models.Metadata.ItemType ItemType
|
||||
=> Data.Models.Metadata.ItemType.SourceDetails;
|
||||
|
||||
public string? Link1
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Link1;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Link1 = value;
|
||||
}
|
||||
|
||||
public bool? Link1Public
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Link1Public;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Link1Public = value;
|
||||
}
|
||||
|
||||
public string? Link2
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Link2;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Link2 = value;
|
||||
}
|
||||
|
||||
public bool? Link2Public
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Link2Public;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Link2Public = value;
|
||||
}
|
||||
|
||||
public string? Link3
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Link3;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Link3 = value;
|
||||
}
|
||||
|
||||
public bool? Link3Public
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Link3Public;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Link3Public = value;
|
||||
}
|
||||
|
||||
public string? MediaTitle
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.MediaTitle;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.MediaTitle = value;
|
||||
}
|
||||
|
||||
public bool? Nodump
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Nodump;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Nodump = value;
|
||||
}
|
||||
|
||||
public string? Origin
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Origin;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Origin = value;
|
||||
}
|
||||
|
||||
public string? OriginalFormat
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.OriginalFormat;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.OriginalFormat = value;
|
||||
}
|
||||
|
||||
public string? Project
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Project;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Project = value;
|
||||
}
|
||||
|
||||
public string? Region
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Region;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Region = value;
|
||||
}
|
||||
|
||||
public string? ReleaseDate
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.ReleaseDate;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.ReleaseDate = value;
|
||||
}
|
||||
|
||||
public bool? ReleaseDateInfo
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.ReleaseDateInfo;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.ReleaseDateInfo = value;
|
||||
}
|
||||
|
||||
public string? RomInfo
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.RomInfo;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.RomInfo = value;
|
||||
}
|
||||
|
||||
public string? Section
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Section;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Section = value;
|
||||
}
|
||||
|
||||
public string? Tool
|
||||
{
|
||||
get => (_internal as Data.Models.Metadata.SourceDetails)?.Tool;
|
||||
set => (_internal as Data.Models.Metadata.SourceDetails)?.Tool = value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
@@ -849,6 +849,79 @@ namespace SabreTools.Metadata.Filter
|
||||
checkValue = item.Channels?.ToString();
|
||||
return true;
|
||||
|
||||
case SourceDetails item when fieldName == "appendtonumber":
|
||||
checkValue = item.AppendToNumber;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "comment1":
|
||||
checkValue = item.Comment1;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "comment2":
|
||||
checkValue = item.Comment2;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "dumpdate":
|
||||
checkValue = item.DumpDate;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "dumpdateinfo":
|
||||
checkValue = item.DumpDateInfo is null ? null : (item.DumpDateInfo == true ? "1" : "0");
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "dumper":
|
||||
checkValue = item.Dumper;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "id":
|
||||
checkValue = item.Id;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "link1":
|
||||
checkValue = item.Link1;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "link1public":
|
||||
checkValue = item.Link1Public is null ? null : (item.Link1Public == true ? "1" : "0");
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "link2":
|
||||
checkValue = item.Link2;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "link2public":
|
||||
checkValue = item.Link2Public is null ? null : (item.Link2Public == true ? "1" : "0");
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "link3":
|
||||
checkValue = item.Link3;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "link3public":
|
||||
checkValue = item.Link3Public is null ? null : (item.Link3Public == true ? "1" : "0");
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "mediatitle":
|
||||
checkValue = item.MediaTitle;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "nodump":
|
||||
checkValue = item.Nodump is null ? null : (item.Nodump == true ? "1" : "0");
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "origin":
|
||||
checkValue = item.Origin;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "originalformat":
|
||||
checkValue = item.OriginalFormat;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "project":
|
||||
checkValue = item.Project;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "region":
|
||||
checkValue = item.Region;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "releasedate":
|
||||
checkValue = item.ReleaseDate;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "releasedateinfo":
|
||||
checkValue = item.ReleaseDateInfo is null ? null : (item.ReleaseDateInfo == true ? "1" : "0");
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "rominfo":
|
||||
checkValue = item.RomInfo;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "section":
|
||||
checkValue = item.Section;
|
||||
return true;
|
||||
case SourceDetails item when fieldName == "tool":
|
||||
checkValue = item.Tool;
|
||||
return true;
|
||||
|
||||
case Video item when fieldName == "aspectx":
|
||||
checkValue = item.AspectX?.ToString();
|
||||
return true;
|
||||
|
||||
@@ -340,6 +340,11 @@ namespace SabreTools.Metadata
|
||||
if (!selfSound.Equals(otherSound))
|
||||
return false;
|
||||
}
|
||||
else if (self is SourceDetails selfSourceDetails && other is SourceDetails otherSourceDetails)
|
||||
{
|
||||
if (!selfSourceDetails.Equals(otherSourceDetails))
|
||||
return false;
|
||||
}
|
||||
else if (self is Video selfVideo && other is Video otherVideo)
|
||||
{
|
||||
if (!selfVideo.Equals(otherVideo))
|
||||
|
||||
@@ -145,23 +145,23 @@ namespace SabreTools.Serialization.Readers.Test
|
||||
Section = "XXXXXX",
|
||||
RomInfo = "XXXXXX",
|
||||
DumpDate = "XXXXXX",
|
||||
DumpDateInfo = "XXXXXX",
|
||||
DumpDateInfo = true,
|
||||
ReleaseDate = "XXXXXX",
|
||||
ReleaseDateInfo = "XXXXXX",
|
||||
ReleaseDateInfo = true,
|
||||
Dumper = "XXXXXX",
|
||||
Project = "XXXXXX",
|
||||
OriginalFormat = "XXXXXX",
|
||||
Nodump = "XXXXXX",
|
||||
Nodump = true,
|
||||
Tool = "XXXXXX",
|
||||
Origin = "XXXXXX",
|
||||
Comment1 = "XXXXXX",
|
||||
Comment2 = "XXXXXX",
|
||||
Link1 = "XXXXXX",
|
||||
Link1Public = "XXXXXX",
|
||||
Link1Public = true,
|
||||
Link2 = "XXXXXX",
|
||||
Link2Public = "XXXXXX",
|
||||
Link2Public = true,
|
||||
Link3 = "XXXXXX",
|
||||
Link3Public = "XXXXXX",
|
||||
Link3Public = true,
|
||||
Region = "XXXXXX",
|
||||
MediaTitle = "XXXXXX",
|
||||
};
|
||||
@@ -361,23 +361,23 @@ namespace SabreTools.Serialization.Readers.Test
|
||||
Assert.Equal("XXXXXX", sourceDetails.Section);
|
||||
Assert.Equal("XXXXXX", sourceDetails.RomInfo);
|
||||
Assert.Equal("XXXXXX", sourceDetails.DumpDate);
|
||||
Assert.Equal("XXXXXX", sourceDetails.DumpDateInfo);
|
||||
Assert.Equal(true, sourceDetails.DumpDateInfo);
|
||||
Assert.Equal("XXXXXX", sourceDetails.ReleaseDate);
|
||||
Assert.Equal("XXXXXX", sourceDetails.ReleaseDateInfo);
|
||||
Assert.Equal(true, sourceDetails.ReleaseDateInfo);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Dumper);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Project);
|
||||
Assert.Equal("XXXXXX", sourceDetails.OriginalFormat);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Nodump);
|
||||
Assert.Equal(true, sourceDetails.Nodump);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Tool);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Origin);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Comment1);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Comment2);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Link1);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Link1Public);
|
||||
Assert.Equal(true, sourceDetails.Link1Public);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Link2);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Link2Public);
|
||||
Assert.Equal(true, sourceDetails.Link2Public);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Link3);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Link3Public);
|
||||
Assert.Equal(true, sourceDetails.Link3Public);
|
||||
Assert.Equal("XXXXXX", sourceDetails.Region);
|
||||
Assert.Equal("XXXXXX", sourceDetails.MediaTitle);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using SabreTools.Data.Extensions;
|
||||
using SabreTools.Data.Models.NoIntroDatabase;
|
||||
|
||||
namespace SabreTools.Serialization.Readers
|
||||
@@ -463,23 +464,23 @@ namespace SabreTools.Serialization.Readers
|
||||
obj.Section = reader.GetAttribute("section");
|
||||
obj.RomInfo = reader.GetAttribute("rominfo");
|
||||
obj.DumpDate = reader.GetAttribute("d_date");
|
||||
obj.DumpDateInfo = reader.GetAttribute("d_date_info");
|
||||
obj.DumpDateInfo = reader.GetAttribute("d_date_info").AsYesNo();
|
||||
obj.ReleaseDate = reader.GetAttribute("r_date");
|
||||
obj.ReleaseDateInfo = reader.GetAttribute("r_date_info");
|
||||
obj.ReleaseDateInfo = reader.GetAttribute("r_date_info").AsYesNo();
|
||||
obj.Dumper = reader.GetAttribute("dumper");
|
||||
obj.Project = reader.GetAttribute("project");
|
||||
obj.OriginalFormat = reader.GetAttribute("originalformat");
|
||||
obj.Nodump = reader.GetAttribute("nodump");
|
||||
obj.Nodump = reader.GetAttribute("nodump").AsYesNo();
|
||||
obj.Tool = reader.GetAttribute("tool");
|
||||
obj.Origin = reader.GetAttribute("origin");
|
||||
obj.Comment1 = reader.GetAttribute("comment1");
|
||||
obj.Comment2 = reader.GetAttribute("comment2");
|
||||
obj.Link1 = reader.GetAttribute("link1");
|
||||
obj.Link1Public = reader.GetAttribute("link1_public");
|
||||
obj.Link1Public = reader.GetAttribute("link1_public").AsYesNo();
|
||||
obj.Link2 = reader.GetAttribute("link2");
|
||||
obj.Link2Public = reader.GetAttribute("link2_public");
|
||||
obj.Link2Public = reader.GetAttribute("link2_public").AsYesNo();
|
||||
obj.Link3 = reader.GetAttribute("link3");
|
||||
obj.Link3Public = reader.GetAttribute("link3_public");
|
||||
obj.Link3Public = reader.GetAttribute("link3_public").AsYesNo();
|
||||
obj.Region = reader.GetAttribute("region");
|
||||
obj.MediaTitle = reader.GetAttribute("media_title");
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace SabreTools.Serialization.Writers
|
||||
}
|
||||
}
|
||||
|
||||
writer.WriteEndElement();
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -322,23 +322,29 @@ namespace SabreTools.Serialization.Writers
|
||||
writer.WriteOptionalAttributeString("section", obj.Section);
|
||||
writer.WriteOptionalAttributeString("rominfo", obj.RomInfo);
|
||||
writer.WriteOptionalAttributeString("d_date", obj.DumpDate);
|
||||
writer.WriteOptionalAttributeString("d_date_info", obj.DumpDateInfo);
|
||||
if (obj.DumpDateInfo is not null)
|
||||
writer.WriteOptionalAttributeString("d_date_info", obj.DumpDateInfo.Value ? "1" : "0");
|
||||
writer.WriteOptionalAttributeString("r_date", obj.ReleaseDate);
|
||||
writer.WriteOptionalAttributeString("r_date_info", obj.ReleaseDateInfo);
|
||||
if (obj.ReleaseDateInfo is not null)
|
||||
writer.WriteOptionalAttributeString("r_date_info", obj.ReleaseDateInfo.Value ? "1" : "0");
|
||||
writer.WriteOptionalAttributeString("dumper", obj.Dumper);
|
||||
writer.WriteOptionalAttributeString("project", obj.Project);
|
||||
writer.WriteOptionalAttributeString("originalformat", obj.OriginalFormat);
|
||||
writer.WriteOptionalAttributeString("nodump", obj.Nodump);
|
||||
if (obj.Nodump is not null)
|
||||
writer.WriteOptionalAttributeString("nodump", obj.Nodump.Value ? "1" : "0");
|
||||
writer.WriteOptionalAttributeString("tool", obj.Tool);
|
||||
writer.WriteOptionalAttributeString("origin", obj.Origin);
|
||||
writer.WriteOptionalAttributeString("comment1", obj.Comment1);
|
||||
writer.WriteOptionalAttributeString("comment2", obj.Comment2);
|
||||
writer.WriteOptionalAttributeString("link1", obj.Link1);
|
||||
writer.WriteOptionalAttributeString("link1_public", obj.Link1Public);
|
||||
if (obj.Link1Public is not null)
|
||||
writer.WriteOptionalAttributeString("link1_public", obj.Link1Public.Value ? "1" : "0");
|
||||
writer.WriteOptionalAttributeString("link2", obj.Link2);
|
||||
writer.WriteOptionalAttributeString("link2_public", obj.Link2Public);
|
||||
if (obj.Link2Public is not null)
|
||||
writer.WriteOptionalAttributeString("link2_public", obj.Link2Public.Value ? "1" : "0");
|
||||
writer.WriteOptionalAttributeString("link3", obj.Link3);
|
||||
writer.WriteOptionalAttributeString("link3_public", obj.Link3Public);
|
||||
if (obj.Link3Public is not null)
|
||||
writer.WriteOptionalAttributeString("link3_public", obj.Link3Public.Value ? "1" : "0");
|
||||
writer.WriteOptionalAttributeString("region", obj.Region);
|
||||
writer.WriteOptionalAttributeString("media_title", obj.MediaTitle);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user