mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Update serials and details objects
This commit is contained in:
@@ -279,7 +279,6 @@ namespace SabreTools.Core
|
|||||||
Configuration,
|
Configuration,
|
||||||
Control,
|
Control,
|
||||||
DataArea,
|
DataArea,
|
||||||
Details,
|
|
||||||
Device,
|
Device,
|
||||||
DeviceReference,
|
DeviceReference,
|
||||||
DipSwitch,
|
DipSwitch,
|
||||||
@@ -298,6 +297,7 @@ namespace SabreTools.Core
|
|||||||
Port,
|
Port,
|
||||||
RamOption,
|
RamOption,
|
||||||
Release,
|
Release,
|
||||||
|
ReleaseDetails,
|
||||||
Sample,
|
Sample,
|
||||||
Serials,
|
Serials,
|
||||||
Setting,
|
Setting,
|
||||||
@@ -306,6 +306,7 @@ namespace SabreTools.Core
|
|||||||
SlotOption,
|
SlotOption,
|
||||||
SoftwareList,
|
SoftwareList,
|
||||||
Sound,
|
Sound,
|
||||||
|
SourceDetails,
|
||||||
|
|
||||||
Blank = 99, // This is not a real type, only used internally
|
Blank = 99, // This is not a real type, only used internally
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -977,14 +977,19 @@ namespace SabreTools.Core.Tools
|
|||||||
"port" => ItemType.Port,
|
"port" => ItemType.Port,
|
||||||
"ramoption" => ItemType.RamOption,
|
"ramoption" => ItemType.RamOption,
|
||||||
"release" => ItemType.Release,
|
"release" => ItemType.Release,
|
||||||
|
"releasedetails" => ItemType.ReleaseDetails,
|
||||||
|
"release_details" => ItemType.ReleaseDetails,
|
||||||
"rom" => ItemType.Rom,
|
"rom" => ItemType.Rom,
|
||||||
"sample" => ItemType.Sample,
|
"sample" => ItemType.Sample,
|
||||||
|
"serials" => ItemType.Serials,
|
||||||
"setting" => ItemType.Setting,
|
"setting" => ItemType.Setting,
|
||||||
"sharedfeat" => ItemType.SharedFeature,
|
"sharedfeat" => ItemType.SharedFeature,
|
||||||
"slot" => ItemType.Slot,
|
"slot" => ItemType.Slot,
|
||||||
"slotoption" => ItemType.SlotOption,
|
"slotoption" => ItemType.SlotOption,
|
||||||
"softwarelist" => ItemType.SoftwareList,
|
"softwarelist" => ItemType.SoftwareList,
|
||||||
"sound" => ItemType.Sound,
|
"sound" => ItemType.Sound,
|
||||||
|
"sourcedetails" => ItemType.SourceDetails,
|
||||||
|
"source_details" => ItemType.SourceDetails,
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1675,14 +1680,17 @@ namespace SabreTools.Core.Tools
|
|||||||
ItemType.Port => "port",
|
ItemType.Port => "port",
|
||||||
ItemType.RamOption => "ramoption",
|
ItemType.RamOption => "ramoption",
|
||||||
ItemType.Release => "release",
|
ItemType.Release => "release",
|
||||||
|
ItemType.ReleaseDetails => "release_details",
|
||||||
ItemType.Rom => "rom",
|
ItemType.Rom => "rom",
|
||||||
ItemType.Sample => "sample",
|
ItemType.Sample => "sample",
|
||||||
ItemType.Setting => "setting",
|
ItemType.Serials => "sample",
|
||||||
|
ItemType.Setting => "serials",
|
||||||
ItemType.SharedFeature => "sharedfeat",
|
ItemType.SharedFeature => "sharedfeat",
|
||||||
ItemType.Slot => "slot",
|
ItemType.Slot => "slot",
|
||||||
ItemType.SlotOption => "slotoption",
|
ItemType.SlotOption => "slotoption",
|
||||||
ItemType.SoftwareList => "softwarelist",
|
ItemType.SoftwareList => "softwarelist",
|
||||||
ItemType.Sound => "sound",
|
ItemType.Sound => "sound",
|
||||||
|
ItemType.SourceDetails => "source_details",
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -295,12 +295,18 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
case ItemType.Release:
|
case ItemType.Release:
|
||||||
datItem = datItemObj.ToObject<Release>();
|
datItem = datItemObj.ToObject<Release>();
|
||||||
break;
|
break;
|
||||||
|
case ItemType.ReleaseDetails:
|
||||||
|
datItem = datItemObj.ToObject<ReleaseDetails>();
|
||||||
|
break;
|
||||||
case ItemType.Rom:
|
case ItemType.Rom:
|
||||||
datItem = datItemObj.ToObject<Rom>();
|
datItem = datItemObj.ToObject<Rom>();
|
||||||
break;
|
break;
|
||||||
case ItemType.Sample:
|
case ItemType.Sample:
|
||||||
datItem = datItemObj.ToObject<Sample>();
|
datItem = datItemObj.ToObject<Sample>();
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Serials:
|
||||||
|
datItem = datItemObj.ToObject<Serials>();
|
||||||
|
break;
|
||||||
case ItemType.Setting:
|
case ItemType.Setting:
|
||||||
datItem = datItemObj.ToObject<Setting>();
|
datItem = datItemObj.ToObject<Setting>();
|
||||||
break;
|
break;
|
||||||
@@ -319,6 +325,9 @@ namespace SabreTools.DatFiles.Formats
|
|||||||
case ItemType.Sound:
|
case ItemType.Sound:
|
||||||
datItem = datItemObj.ToObject<Sound>();
|
datItem = datItemObj.ToObject<Sound>();
|
||||||
break;
|
break;
|
||||||
|
case ItemType.SourceDetails:
|
||||||
|
datItem = datItemObj.ToObject<SourceDetails>();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -236,6 +236,12 @@ namespace SabreTools.DatFiles
|
|||||||
[JsonIgnore, XmlIgnore]
|
[JsonIgnore, XmlIgnore]
|
||||||
public long ReleaseCount { get; private set; } = 0;
|
public long ReleaseCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of ReleaseDetails items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore, XmlIgnore]
|
||||||
|
public long ReleaseDetailsCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of Rom items
|
/// Number of Rom items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -248,6 +254,12 @@ namespace SabreTools.DatFiles
|
|||||||
[JsonIgnore, XmlIgnore]
|
[JsonIgnore, XmlIgnore]
|
||||||
public long SampleCount { get; private set; } = 0;
|
public long SampleCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of Serials items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore, XmlIgnore]
|
||||||
|
public long SerialsCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of SharedFeature items
|
/// Number of SharedFeature items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -272,6 +284,12 @@ namespace SabreTools.DatFiles
|
|||||||
[JsonIgnore, XmlIgnore]
|
[JsonIgnore, XmlIgnore]
|
||||||
public long SoundCount { get; private set; } = 0;
|
public long SoundCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of SourceDetails items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore, XmlIgnore]
|
||||||
|
public long SourceDetailsCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of machines
|
/// Number of machines
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -530,6 +548,9 @@ namespace SabreTools.DatFiles
|
|||||||
case ItemType.Release:
|
case ItemType.Release:
|
||||||
ReleaseCount++;
|
ReleaseCount++;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.ReleaseDetails:
|
||||||
|
ReleaseDetailsCount++;
|
||||||
|
break;
|
||||||
case ItemType.Rom:
|
case ItemType.Rom:
|
||||||
RomCount++;
|
RomCount++;
|
||||||
if ((item as Rom).ItemStatus != ItemStatus.Nodump)
|
if ((item as Rom).ItemStatus != ItemStatus.Nodump)
|
||||||
@@ -552,6 +573,9 @@ namespace SabreTools.DatFiles
|
|||||||
case ItemType.Sample:
|
case ItemType.Sample:
|
||||||
SampleCount++;
|
SampleCount++;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Serials:
|
||||||
|
SerialsCount++;
|
||||||
|
break;
|
||||||
case ItemType.SharedFeature:
|
case ItemType.SharedFeature:
|
||||||
SharedFeatureCount++;
|
SharedFeatureCount++;
|
||||||
break;
|
break;
|
||||||
@@ -564,6 +588,9 @@ namespace SabreTools.DatFiles
|
|||||||
case ItemType.Sound:
|
case ItemType.Sound:
|
||||||
SoundCount++;
|
SoundCount++;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.SourceDetails:
|
||||||
|
SourceDetailsCount++;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,6 +290,12 @@ namespace SabreTools.DatFiles
|
|||||||
[JsonIgnore, XmlIgnore]
|
[JsonIgnore, XmlIgnore]
|
||||||
public long ReleaseCount { get; private set; } = 0;
|
public long ReleaseCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of ReleaseDetails items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore, XmlIgnore]
|
||||||
|
public long ReleaseDetailsCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of Rom items
|
/// Number of Rom items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -302,6 +308,12 @@ namespace SabreTools.DatFiles
|
|||||||
[JsonIgnore, XmlIgnore]
|
[JsonIgnore, XmlIgnore]
|
||||||
public long SampleCount { get; private set; } = 0;
|
public long SampleCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of Serials items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore, XmlIgnore]
|
||||||
|
public long SerialsCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of SharedFeature items
|
/// Number of SharedFeature items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -326,6 +338,12 @@ namespace SabreTools.DatFiles
|
|||||||
[JsonIgnore, XmlIgnore]
|
[JsonIgnore, XmlIgnore]
|
||||||
public long SoundCount { get; private set; } = 0;
|
public long SoundCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of SourceDetails items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore, XmlIgnore]
|
||||||
|
public long SourceDetailsCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of machines
|
/// Number of machines
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -644,6 +662,9 @@ namespace SabreTools.DatFiles
|
|||||||
case ItemType.Release:
|
case ItemType.Release:
|
||||||
ReleaseCount++;
|
ReleaseCount++;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.ReleaseDetails:
|
||||||
|
ReleaseDetailsCount++;
|
||||||
|
break;
|
||||||
case ItemType.Rom:
|
case ItemType.Rom:
|
||||||
RomCount++;
|
RomCount++;
|
||||||
if ((item as Rom).ItemStatus != ItemStatus.Nodump)
|
if ((item as Rom).ItemStatus != ItemStatus.Nodump)
|
||||||
@@ -666,6 +687,9 @@ namespace SabreTools.DatFiles
|
|||||||
case ItemType.Sample:
|
case ItemType.Sample:
|
||||||
SampleCount++;
|
SampleCount++;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Serials:
|
||||||
|
SerialsCount++;
|
||||||
|
break;
|
||||||
case ItemType.SharedFeature:
|
case ItemType.SharedFeature:
|
||||||
SharedFeatureCount++;
|
SharedFeatureCount++;
|
||||||
break;
|
break;
|
||||||
@@ -678,6 +702,9 @@ namespace SabreTools.DatFiles
|
|||||||
case ItemType.Sound:
|
case ItemType.Sound:
|
||||||
SoundCount++;
|
SoundCount++;
|
||||||
break;
|
break;
|
||||||
|
case ItemType.SourceDetails:
|
||||||
|
SourceDetailsCount++;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ namespace SabreTools.DatItems
|
|||||||
ItemType.Chip => new Chip(),
|
ItemType.Chip => new Chip(),
|
||||||
ItemType.Condition => new Condition(),
|
ItemType.Condition => new Condition(),
|
||||||
ItemType.Configuration => new Configuration(),
|
ItemType.Configuration => new Configuration(),
|
||||||
ItemType.Details => new Details(),
|
|
||||||
ItemType.Device => new Device(),
|
ItemType.Device => new Device(),
|
||||||
ItemType.DeviceReference => new DeviceReference(),
|
ItemType.DeviceReference => new DeviceReference(),
|
||||||
ItemType.DipSwitch => new DipSwitch(),
|
ItemType.DipSwitch => new DipSwitch(),
|
||||||
@@ -187,6 +186,7 @@ namespace SabreTools.DatItems
|
|||||||
ItemType.Port => new Port(),
|
ItemType.Port => new Port(),
|
||||||
ItemType.RamOption => new RamOption(),
|
ItemType.RamOption => new RamOption(),
|
||||||
ItemType.Release => new Release(),
|
ItemType.Release => new Release(),
|
||||||
|
ItemType.ReleaseDetails => new ReleaseDetails(),
|
||||||
ItemType.Rom => new Rom(),
|
ItemType.Rom => new Rom(),
|
||||||
ItemType.Sample => new Sample(),
|
ItemType.Sample => new Sample(),
|
||||||
ItemType.Serials => new Serials(),
|
ItemType.Serials => new Serials(),
|
||||||
@@ -195,6 +195,7 @@ namespace SabreTools.DatItems
|
|||||||
ItemType.SlotOption => new SlotOption(),
|
ItemType.SlotOption => new SlotOption(),
|
||||||
ItemType.SoftwareList => new SoftwareList(),
|
ItemType.SoftwareList => new SoftwareList(),
|
||||||
ItemType.Sound => new Sound(),
|
ItemType.Sound => new Sound(),
|
||||||
|
ItemType.SourceDetails => new SourceDetails(),
|
||||||
_ => new Rom(),
|
_ => new Rom(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
190
SabreTools.DatItems/Formats/ReleaseDetails.cs
Normal file
190
SabreTools.DatItems/Formats/ReleaseDetails.cs
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
using System.Xml.Serialization;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using SabreTools.Core;
|
||||||
|
|
||||||
|
// TODO: Add item mappings for all fields
|
||||||
|
namespace SabreTools.DatItems.Formats
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a single release details item
|
||||||
|
/// </summary>
|
||||||
|
[JsonObject("release_details"), XmlRoot("release_details")]
|
||||||
|
public class ReleaseDetails : DatItem
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id value
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>TODO: Is this required?</remarks>
|
||||||
|
[JsonProperty("id", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("id")]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Directory name value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("dirname", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("dirname")]
|
||||||
|
public string DirName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Rom info value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("rominfo", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("rominfo")]
|
||||||
|
public string RomInfo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Category value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("category", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("category")]
|
||||||
|
public string Category { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NFO name value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("nfoname", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("nfoname")]
|
||||||
|
public string NfoName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NFO size value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("nfosize", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("nfosize")]
|
||||||
|
public long? NfoSize { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool NfoSizeSpecified { get { return NfoSize != null; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NFO CRC value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("nfocrc", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("nfocrc")]
|
||||||
|
public string NfoCrc { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Archive name value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("archivename", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("archivename")]
|
||||||
|
public string ArchiveName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Original format value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("originalformat", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("originalformat")]
|
||||||
|
public string OriginalFormat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Date value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("date", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("date")]
|
||||||
|
public string Date { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Grpup value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("group", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("group")]
|
||||||
|
public string Group { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Comment value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("comment", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("comment")]
|
||||||
|
public string Comment { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tool value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("tool", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("tool")]
|
||||||
|
public string Tool { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Region value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("region", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("region")]
|
||||||
|
public string Region { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Origin value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("origin", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("origin")]
|
||||||
|
public string Origin { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a default, empty ReleaseDetails object
|
||||||
|
/// </summary>
|
||||||
|
public ReleaseDetails()
|
||||||
|
{
|
||||||
|
ItemType = ItemType.ReleaseDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Cloning Methods
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override object Clone()
|
||||||
|
{
|
||||||
|
return new ReleaseDetails()
|
||||||
|
{
|
||||||
|
ItemType = this.ItemType,
|
||||||
|
DupeType = this.DupeType,
|
||||||
|
|
||||||
|
Machine = this.Machine.Clone() as Machine,
|
||||||
|
Source = this.Source.Clone() as Source,
|
||||||
|
Remove = this.Remove,
|
||||||
|
|
||||||
|
Id = this.Id,
|
||||||
|
DirName = this.DirName,
|
||||||
|
RomInfo = this.RomInfo,
|
||||||
|
Category = this.Category,
|
||||||
|
NfoName = this.NfoName,
|
||||||
|
NfoSize = this.NfoSize,
|
||||||
|
NfoCrc = this.NfoCrc,
|
||||||
|
ArchiveName = this.ArchiveName,
|
||||||
|
OriginalFormat = this.OriginalFormat,
|
||||||
|
Date = this.Date,
|
||||||
|
Group = this.Group,
|
||||||
|
Comment = this.Comment,
|
||||||
|
Tool = this.Tool,
|
||||||
|
Region = this.Region,
|
||||||
|
Origin = this.Origin,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Comparision Methods
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override bool Equals(DatItem other)
|
||||||
|
{
|
||||||
|
// If we don't have a Details, return false
|
||||||
|
if (ItemType != other.ItemType)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Otherwise, treat it as a Details
|
||||||
|
ReleaseDetails newOther = other as ReleaseDetails;
|
||||||
|
|
||||||
|
// If the Details information matches
|
||||||
|
return (Id == newOther.Id
|
||||||
|
&& DirName == newOther.DirName
|
||||||
|
&& RomInfo == newOther.RomInfo
|
||||||
|
&& Category == newOther.Category
|
||||||
|
&& NfoName == newOther.NfoName
|
||||||
|
&& NfoSize == newOther.NfoSize
|
||||||
|
&& NfoCrc == newOther.NfoCrc
|
||||||
|
&& ArchiveName == newOther.ArchiveName
|
||||||
|
&& OriginalFormat == newOther.OriginalFormat
|
||||||
|
&& Date == newOther.Date
|
||||||
|
&& Group == newOther.Group
|
||||||
|
&& Comment == newOther.Comment
|
||||||
|
&& Tool == newOther.Tool
|
||||||
|
&& Region == newOther.Region
|
||||||
|
&& Origin == newOther.Origin);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,18 @@ namespace SabreTools.DatItems.Formats
|
|||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Digital serial 1 value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("digital_serial1", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("digital_serial1")]
|
||||||
|
public string DigitalSerial1 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Digital serial 2 value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("digital_serial2", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("digital_serial2")]
|
||||||
|
public string DigitalSerial2 { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Media serial 1 value
|
/// Media serial 1 value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -25,6 +37,12 @@ namespace SabreTools.DatItems.Formats
|
|||||||
[JsonProperty("media_serial2", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("media_serial2")]
|
[JsonProperty("media_serial2", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("media_serial2")]
|
||||||
public string MediaSerial2 { get; set; }
|
public string MediaSerial2 { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Media serial 3 value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("media_serial3", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("media_serial3")]
|
||||||
|
public string MediaSerial3 { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// PCB serial value
|
/// PCB serial value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -43,12 +61,6 @@ namespace SabreTools.DatItems.Formats
|
|||||||
[JsonProperty("romchip_serial2", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("romchip_serial2")]
|
[JsonProperty("romchip_serial2", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("romchip_serial2")]
|
||||||
public string RomChipSerial2 { get; set; }
|
public string RomChipSerial2 { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Chip serial value
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("chip_serial", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("chip_serial")]
|
|
||||||
public string ChipSerial { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lockout serial value
|
/// Lockout serial value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -61,12 +73,30 @@ namespace SabreTools.DatItems.Formats
|
|||||||
[JsonProperty("savechip_serial", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("savechip_serial")]
|
[JsonProperty("savechip_serial", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("savechip_serial")]
|
||||||
public string SaveChipSerial { get; set; }
|
public string SaveChipSerial { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Chip serial value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("chip_serial", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("chip_serial")]
|
||||||
|
public string ChipSerial { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Box serial value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("box_serial", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("box_serial")]
|
||||||
|
public string BoxSerial { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Media stamp value
|
/// Media stamp value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("mediastamp", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("mediastamp")]
|
[JsonProperty("mediastamp", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("mediastamp")]
|
||||||
public string MediaStamp { get; set; }
|
public string MediaStamp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Box barcode value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("box_barcode", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("box_barcode")]
|
||||||
|
public string BoxBarcode { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@@ -95,15 +125,20 @@ namespace SabreTools.DatItems.Formats
|
|||||||
Source = this.Source.Clone() as Source,
|
Source = this.Source.Clone() as Source,
|
||||||
Remove = this.Remove,
|
Remove = this.Remove,
|
||||||
|
|
||||||
|
DigitalSerial1 = this.DigitalSerial1,
|
||||||
|
DigitalSerial2 = this.DigitalSerial2,
|
||||||
MediaSerial1 = this.MediaSerial1,
|
MediaSerial1 = this.MediaSerial1,
|
||||||
MediaSerial2 = this.MediaSerial2,
|
MediaSerial2 = this.MediaSerial2,
|
||||||
|
MediaSerial3 = this.MediaSerial3,
|
||||||
PcbSerial = this.PcbSerial,
|
PcbSerial = this.PcbSerial,
|
||||||
RomChipSerial1 = this.RomChipSerial1,
|
RomChipSerial1 = this.RomChipSerial1,
|
||||||
RomChipSerial2 = this.RomChipSerial2,
|
RomChipSerial2 = this.RomChipSerial2,
|
||||||
ChipSerial = this.ChipSerial,
|
|
||||||
LockoutSerial = this.LockoutSerial,
|
LockoutSerial = this.LockoutSerial,
|
||||||
SaveChipSerial = this.SaveChipSerial,
|
SaveChipSerial = this.SaveChipSerial,
|
||||||
|
ChipSerial = this.ChipSerial,
|
||||||
|
BoxSerial = this.BoxSerial,
|
||||||
MediaStamp = this.MediaStamp,
|
MediaStamp = this.MediaStamp,
|
||||||
|
BoxBarcode = this.BoxBarcode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,15 +157,20 @@ namespace SabreTools.DatItems.Formats
|
|||||||
Serials newOther = other as Serials;
|
Serials newOther = other as Serials;
|
||||||
|
|
||||||
// If the Serials information matches
|
// If the Serials information matches
|
||||||
return (MediaSerial1 == newOther.MediaSerial1
|
return (DigitalSerial1 == newOther.DigitalSerial1
|
||||||
|
&& DigitalSerial2 == newOther.DigitalSerial2
|
||||||
|
&& MediaSerial1 == newOther.MediaSerial1
|
||||||
&& MediaSerial2 == newOther.MediaSerial2
|
&& MediaSerial2 == newOther.MediaSerial2
|
||||||
|
&& MediaSerial3 == newOther.MediaSerial3
|
||||||
&& PcbSerial == newOther.PcbSerial
|
&& PcbSerial == newOther.PcbSerial
|
||||||
&& RomChipSerial1 == newOther.RomChipSerial1
|
&& RomChipSerial1 == newOther.RomChipSerial1
|
||||||
&& RomChipSerial2 == newOther.RomChipSerial2
|
&& RomChipSerial2 == newOther.RomChipSerial2
|
||||||
&& ChipSerial == newOther.ChipSerial
|
|
||||||
&& LockoutSerial == newOther.LockoutSerial
|
&& LockoutSerial == newOther.LockoutSerial
|
||||||
&& SaveChipSerial == newOther.SaveChipSerial
|
&& SaveChipSerial == newOther.SaveChipSerial
|
||||||
&& MediaStamp == newOther.MediaStamp);
|
&& ChipSerial == newOther.ChipSerial
|
||||||
|
&& BoxSerial == newOther.BoxSerial
|
||||||
|
&& MediaStamp == newOther.MediaStamp
|
||||||
|
&& BoxBarcode == newOther.BoxBarcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ using SabreTools.Core;
|
|||||||
namespace SabreTools.DatItems.Formats
|
namespace SabreTools.DatItems.Formats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a single details item
|
/// Represents a single source details item
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonObject("details"), XmlRoot("details")]
|
[JsonObject("source_details"), XmlRoot("source_details")]
|
||||||
public class Details : DatItem
|
public class SourceDetails : DatItem
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
@@ -26,6 +26,12 @@ namespace SabreTools.DatItems.Formats
|
|||||||
[JsonProperty("section", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("section")]
|
[JsonProperty("section", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("section")]
|
||||||
public string Section { get; set; }
|
public string Section { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Rom info value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("rominfo", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("rominfo")]
|
||||||
|
public string RomInfo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dumping date value
|
/// Dumping date value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -33,49 +39,28 @@ namespace SabreTools.DatItems.Formats
|
|||||||
public string DDate { get; set; }
|
public string DDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Directory name value
|
/// Dumping date info value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("dirname", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("dirname")]
|
[JsonProperty("d_date_info", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("d_date_info")]
|
||||||
public string DirName { get; set; }
|
public string DDateInfo { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// NFO name value
|
/// Release date value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("nfoname", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("nfoname")]
|
[JsonProperty("r_date", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("r_date")]
|
||||||
public string NfoName { get; set; }
|
public string RDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// NFO size value
|
/// Release date info value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("nfosize", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("nfosize")]
|
[JsonProperty("r_date_info", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("r_date_info")]
|
||||||
public long? NfoSize { get; set; }
|
public string RDateInfo { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public bool NfoSizeSpecified { get { return NfoSize != null; } }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// NFO CRC value
|
/// Origin value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonProperty("nfocrc", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("nfocrc")]
|
[JsonProperty("origin", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("origin")]
|
||||||
public string NfoCrc { get; set; }
|
public string Origin { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Archive name value
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("archivename", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("archivename")]
|
|
||||||
public string ArchiveName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Date value
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("date", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("date")]
|
|
||||||
public string Date { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Grpup value
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("group", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("group")]
|
|
||||||
public string Group { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Region value
|
/// Region value
|
||||||
@@ -107,6 +92,12 @@ namespace SabreTools.DatItems.Formats
|
|||||||
[JsonProperty("originalformat", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("originalformat")]
|
[JsonProperty("originalformat", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("originalformat")]
|
||||||
public string OriginalFormat { get; set; }
|
public string OriginalFormat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Nodump value
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("nodump", DefaultValueHandling = DefaultValueHandling.Ignore), XmlElement("nodump")]
|
||||||
|
public string Nodump { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tool value
|
/// Tool value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -148,11 +139,11 @@ namespace SabreTools.DatItems.Formats
|
|||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a default, empty Details object
|
/// Create a default, empty SourceDetails object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Details()
|
public SourceDetails()
|
||||||
{
|
{
|
||||||
ItemType = ItemType.Serials;
|
ItemType = ItemType.SourceDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -162,7 +153,7 @@ namespace SabreTools.DatItems.Formats
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override object Clone()
|
public override object Clone()
|
||||||
{
|
{
|
||||||
return new Details()
|
return new SourceDetails()
|
||||||
{
|
{
|
||||||
ItemType = this.ItemType,
|
ItemType = this.ItemType,
|
||||||
DupeType = this.DupeType,
|
DupeType = this.DupeType,
|
||||||
@@ -173,19 +164,18 @@ namespace SabreTools.DatItems.Formats
|
|||||||
|
|
||||||
Id = this.Id,
|
Id = this.Id,
|
||||||
Section = this.Section,
|
Section = this.Section,
|
||||||
|
RomInfo = this.RomInfo,
|
||||||
DDate = this.DDate,
|
DDate = this.DDate,
|
||||||
DirName = this.DirName,
|
DDateInfo = this.DDateInfo,
|
||||||
NfoName = this.NfoName,
|
RDate = this.RDate,
|
||||||
NfoSize = this.NfoSize,
|
RDateInfo = this.RDateInfo,
|
||||||
NfoCrc = this.NfoCrc,
|
Origin = this.Origin,
|
||||||
ArchiveName = this.ArchiveName,
|
|
||||||
Date = this.Date,
|
|
||||||
Group = this.Group,
|
|
||||||
Region = this.Region,
|
Region = this.Region,
|
||||||
MediaTitle = this.MediaTitle,
|
MediaTitle = this.MediaTitle,
|
||||||
Dumper = this.Dumper,
|
Dumper = this.Dumper,
|
||||||
Project = this.Project,
|
Project = this.Project,
|
||||||
OriginalFormat = this.OriginalFormat,
|
OriginalFormat = this.OriginalFormat,
|
||||||
|
Nodump = this.Nodump,
|
||||||
Tool = this.Tool,
|
Tool = this.Tool,
|
||||||
Comment1 = this.Comment1,
|
Comment1 = this.Comment1,
|
||||||
Comment2 = this.Comment2,
|
Comment2 = this.Comment2,
|
||||||
@@ -202,29 +192,29 @@ namespace SabreTools.DatItems.Formats
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override bool Equals(DatItem other)
|
public override bool Equals(DatItem other)
|
||||||
{
|
{
|
||||||
// If we don't have a Details, return false
|
// If we don't have a SourceDetails, return false
|
||||||
if (ItemType != other.ItemType)
|
if (ItemType != other.ItemType)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Otherwise, treat it as a Details
|
// Otherwise, treat it as a SourceDetails
|
||||||
Details newOther = other as Details;
|
SourceDetails newOther = other as SourceDetails;
|
||||||
|
|
||||||
// If the Details information matches
|
// If the Details information matches
|
||||||
return (Id == newOther.Id
|
return (Id == newOther.Id
|
||||||
&& Section == newOther.Section
|
&& Section == newOther.Section
|
||||||
|
&& RomInfo == newOther.RomInfo
|
||||||
&& DDate == newOther.DDate
|
&& DDate == newOther.DDate
|
||||||
&& DirName == newOther.DirName
|
&& DDateInfo == newOther.DDateInfo
|
||||||
&& NfoName == newOther.NfoName
|
&& RomInfo == newOther.RomInfo
|
||||||
&& NfoSize == newOther.NfoSize
|
&& RDate == newOther.RDate
|
||||||
&& NfoCrc == newOther.NfoCrc
|
&& RDateInfo == newOther.RDateInfo
|
||||||
&& ArchiveName == newOther.ArchiveName
|
&& Origin == newOther.Origin
|
||||||
&& Date == newOther.Date
|
|
||||||
&& Group == newOther.Group
|
|
||||||
&& Region == newOther.Region
|
&& Region == newOther.Region
|
||||||
&& MediaTitle == newOther.MediaTitle
|
&& MediaTitle == newOther.MediaTitle
|
||||||
&& Dumper == newOther.Dumper
|
&& Dumper == newOther.Dumper
|
||||||
&& Project == newOther.Project
|
&& Project == newOther.Project
|
||||||
&& OriginalFormat == newOther.OriginalFormat
|
&& OriginalFormat == newOther.OriginalFormat
|
||||||
|
&& Nodump == newOther.Nodump
|
||||||
&& Tool == newOther.Tool
|
&& Tool == newOther.Tool
|
||||||
&& Comment1 == newOther.Comment1
|
&& Comment1 == newOther.Comment1
|
||||||
&& Comment2 == newOther.Comment2
|
&& Comment2 == newOther.Comment2
|
||||||
Reference in New Issue
Block a user