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