Compare commits

...

22 Commits
1.3.2 ... 1.3.8

Author SHA1 Message Date
Matt Nadareski
341edc56bd Bump version 2024-05-15 17:05:15 -04:00
Matt Nadareski
da4bdac6e2 Update Models 2024-05-15 17:04:55 -04:00
Matt Nadareski
7fe595ee0a Fix ordering of site codes 2024-05-15 16:44:07 -04:00
Matt Nadareski
8a9f62f5a4 Add new tags to formatting list 2024-05-15 16:40:01 -04:00
Matt Nadareski
dbb7cf7ef9 Add missing comment fields to listing 2024-05-15 16:38:17 -04:00
Matt Nadareski
d591ee1550 Bump version 2024-05-15 16:16:37 -04:00
Matt Nadareski
9153c931a5 Include comment/content markers 2024-05-15 16:16:07 -04:00
Matt Nadareski
99ebd1f3ac Add extensions for comment and content codes 2024-05-15 16:09:57 -04:00
Matt Nadareski
844f5506f5 Add Applications pseudotag 2024-05-15 16:09:19 -04:00
Matt Nadareski
4be01b25ab Add EidosID pseudotag 2024-05-15 16:07:00 -04:00
Matt Nadareski
22e2e73f65 Add BethesdaID pseudotag 2024-05-15 16:06:06 -04:00
Matt Nadareski
831ea86d4f Add CompatibleOS pseudotag 2024-05-15 16:04:47 -04:00
Matt Nadareski
4475dba94c Bump version 2024-03-15 12:48:36 -04:00
Matt Nadareski
63a758c005 Fix missing fields from output 2024-03-15 12:48:18 -04:00
Matt Nadareski
7e81f723ca Bump version 2024-03-05 12:30:59 -05:00
Matt Nadareski
f69c7e6bb2 Add new dumping info fields 2024-03-02 19:41:19 -05:00
Matt Nadareski
9d2803a6df Add nuget package and PR workflows 2024-02-27 19:16:31 -05:00
Matt Nadareski
23f1ceac99 Bump version 2024-02-26 20:15:29 -05:00
Deterous
55c621b615 Fill PS3 Disc Key from redump (#3)
* Fill PS3 Disc Key from redump

* Deny NULL rather than only allow hex keys

* Update Builder.cs

Co-authored-by: Matt Nadareski <mnadareski@outlook.com>

---------

Co-authored-by: Matt Nadareski <mnadareski@outlook.com>
2024-02-26 17:04:02 -08:00
Matt Nadareski
29cce4d4b9 Bump version 2024-02-02 11:20:18 -05:00
Matt Nadareski
1f37ece28d Fix typo 2024-02-02 11:20:08 -05:00
Matt Nadareski
6acac60376 Add CD support for GameWave 2024-02-02 11:18:44 -05:00
10 changed files with 262 additions and 5 deletions

43
.github/workflows/build_nupkg.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Nuget Pack
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Pack
run: dotnet pack
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: 'Nuget Package'
path: 'bin/Release/*.nupkg'
- name: Upload to rolling
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: True
artifacts: 'bin/Release/*.nupkg'
body: 'Last built commit: ${{ github.sha }}'
name: 'Rolling Release'
prerelease: True
replacesArtifacts: True
tag: "rolling"
updateOnlyUnreleased: True

17
.github/workflows/check_pr.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: Build PR
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build

View File

@@ -386,6 +386,15 @@ namespace SabreTools.RedumpLib
info.DumpersAndStatus.Dumpers = [.. tempDumpers];
}
// PS3 DiscKey
if (string.IsNullOrEmpty(info.Extras!.DiscKey))
{
// Validate key is not NULL
match = Constants.PS3DiscKey.Match(discData);
if (match.Success && match.Groups[1].Value != "<span class=\"null\">NULL</span>")
info.Extras.DiscKey = match.Groups[1].Value;
}
// TODO: Unify handling of fields that can include site codes (Comments/Contents)
// Comments

View File

@@ -102,6 +102,11 @@ namespace SabreTools.RedumpLib.Data
/// </summary>
public static Regex PartialMatchRegex = new(@"<td class=""static"">partial match ids: (.*?)</td>");
/// <summary>
/// Regex matching the disc key on a PS3 disc page
/// </summary>
public static Regex PS3DiscKey = new(@"<th>Disc Key</th><th>Disc ID</th><th>Permanent Information & Control \(PIC\)</th></tr><tr><td>(.*?)</td><td>");
/// <summary>
/// Regex matching the PVD field on a disc page
/// </summary>

View File

@@ -3526,16 +3526,28 @@ namespace SabreTools.RedumpLib.Data
[HumanReadable(ShortName = "[T:ALTF]", LongName = "<b>Alternative Foreign Title</b>:")]
AlternativeForeignTitle,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Applications</b>:", LongName = "<b>Applications</b>:")]
Applications,
[HumanReadable(ShortName = "[T:BID]", LongName = "<b>Bandai ID</b>:")]
BandaiID,
[HumanReadable(ShortName = "[T:BBFC]", LongName = "<b>BBFC Reg. No.</b>:")]
BBFCRegistrationNumber,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Bethesda ID</b>:", LongName = "<b>Bethesda ID</b>:")]
BethesdaID,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>CD Projekt ID</b>:", LongName = "<b>CD Projekt ID</b>:")]
CDProjektID,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Compatible OS</b>:", LongName = "<b>Compatible OS</b>:")]
CompatibleOS,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Disc Hologram ID</b>:", LongName = "<b>Disc Hologram ID</b>:")]
DiscHologramID,
@@ -3547,6 +3559,10 @@ namespace SabreTools.RedumpLib.Data
[HumanReadable(ShortName = "[T:DNAS]", LongName = "<b>DNAS Disc ID</b>:")]
DNASDiscID,
// TODO: This doesn't have a site tag yet
[HumanReadable(ShortName = "<b>Eidos ID</b>:", LongName = "<b>Eidos ID</b>:")]
EidosID,
[HumanReadable(ShortName = "[T:EAID]", LongName = "<b>Electronic Arts ID</b>:")]
ElectronicArtsID,

View File

@@ -239,6 +239,7 @@ namespace SabreTools.RedumpLib.Data
// https://en.wikipedia.org/wiki/Game_Wave_Family_Entertainment_System
case RedumpSystem.ZAPiTGamesGameWaveFamilyEntertainmentSystem:
types.Add(MediaType.CDROM); // Firmware discs only(?)
types.Add(MediaType.DVD);
break;
@@ -1062,6 +1063,148 @@ namespace SabreTools.RedumpLib.Data
#region Site Code
/// <summary>
/// List all site codes with their short usable names
/// </summary>
public static List<string> ListSiteCodes()
{
var siteCodes = new List<string>();
foreach (var val in Enum.GetValues(typeof(SiteCode)))
{
string? shortName = ((SiteCode?)val).ShortName()?.TrimEnd(':');
string? longName = ((SiteCode?)val).LongName()?.TrimEnd(':');
bool isCommentCode = ((SiteCode?)val).IsCommentCode();
bool isContentCode = ((SiteCode?)val).IsContentCode();
bool isMultiline = ((SiteCode?)val).IsMultiLine();
// Invalid codes should be skipped
if (shortName == null || longName == null)
continue;
// Handle site tags
string siteCode;
if (shortName == longName)
siteCode = "***".PadRight(16, ' ');
else
siteCode = shortName.PadRight(16, ' ');
// Handle expanded tags
siteCode += longName.PadRight(32, ' ');
// Include special indicators, if necessary
var additionalInfo = new List<string>();
if (isCommentCode)
additionalInfo.Add("Comment Field");
if (isContentCode)
additionalInfo.Add("Content Field");
if (isMultiline)
additionalInfo.Add("Multiline");
if (additionalInfo.Count > 0)
siteCode += $"[{string.Join(", ", [.. additionalInfo])}]";
// Add the formatted site code
siteCodes.Add(siteCode);
}
return siteCodes;
}
/// <summary>
/// Check if a site code should live in the comments section
/// </summary>
/// <param name="siteCode">SiteCode to check</param>
/// <returns>True if the code field is in comments by default, false otherwise</returns>
public static bool IsCommentCode(this SiteCode? siteCode)
{
return siteCode switch
{
// Identifying Info
SiteCode.AlternativeTitle => true,
SiteCode.AlternativeForeignTitle => true,
SiteCode.BBFCRegistrationNumber => true,
SiteCode.CompatibleOS => true,
SiteCode.DiscHologramID => true,
SiteCode.DMIHash => true,
SiteCode.DNASDiscID => true,
SiteCode.Filename => true,
SiteCode.Genre => true,
SiteCode.InternalName => true,
SiteCode.InternalSerialName => true,
SiteCode.ISBN => true,
SiteCode.ISSN => true,
SiteCode.Multisession => true,
SiteCode.PFIHash => true,
SiteCode.PostgapType => true,
SiteCode.PPN => true,
SiteCode.RingNonZeroDataStart => true,
SiteCode.Series => true,
SiteCode.SSHash => true,
SiteCode.SSVersion => true,
SiteCode.UniversalHash => true,
SiteCode.VCD => true,
SiteCode.VFCCode => true,
SiteCode.VolumeLabel => true,
SiteCode.XeMID => true,
SiteCode.XMID => true,
// Publisher / Company IDs
SiteCode.AcclaimID => true,
SiteCode.ActivisionID => true,
SiteCode.BandaiID => true,
SiteCode.BethesdaID => true,
SiteCode.CDProjektID => true,
SiteCode.EidosID => true,
SiteCode.ElectronicArtsID => true,
SiteCode.FoxInteractiveID => true,
SiteCode.GTInteractiveID => true,
SiteCode.JASRACID => true,
SiteCode.KingRecordsID => true,
SiteCode.KoeiID => true,
SiteCode.KonamiID => true,
SiteCode.LucasArtsID => true,
SiteCode.MicrosoftID => true,
SiteCode.NaganoID => true,
SiteCode.NamcoID => true,
SiteCode.NipponIchiSoftwareID => true,
SiteCode.OriginID => true,
SiteCode.PonyCanyonID => true,
SiteCode.SegaID => true,
SiteCode.SelenID => true,
SiteCode.SierraID => true,
SiteCode.TaitoID => true,
SiteCode.UbisoftID => true,
SiteCode.ValveID => true,
_ => false,
};
}
/// <summary>
/// Check if a site code should live in the contents section
/// </summary>
/// <param name="siteCode">SiteCode to check</param>
/// <returns>True if the code field is in contents by default, false otherwise</returns>
public static bool IsContentCode(this SiteCode? siteCode)
{
return siteCode switch
{
SiteCode.Applications => true,
SiteCode.Extras => true,
SiteCode.GameFootage => true,
SiteCode.Games => true,
SiteCode.NetYarozeGames => true,
SiteCode.Patches => true,
SiteCode.PlayableDemos => true,
SiteCode.RollingDemos => true,
SiteCode.Savegames => true,
SiteCode.TechDemos => true,
SiteCode.Videos => true,
_ => false,
};
}
/// <summary>
/// Check if a site code is multi-line or not
/// </summary>

View File

@@ -530,6 +530,10 @@ namespace SabreTools.RedumpLib.Data
/// </summary>
public class DumpingInfoSection : ICloneable
{
// Name not defined by Redump -- Only used with MPF
[JsonProperty(PropertyName = "d_frontend_version", Required = Required.AllowNull)]
public string? FrontendVersion { get; set; }
// Name not defined by Redump
[JsonProperty(PropertyName = "d_dumping_program", Required = Required.AllowNull)]
public string? DumpingProgram { get; set; }
@@ -554,16 +558,22 @@ namespace SabreTools.RedumpLib.Data
[JsonProperty(PropertyName = "d_reported_disc_type", Required = Required.AllowNull)]
public string? ReportedDiscType { get; set; }
// Name not defined by Redump -- Only used with Redumper
[JsonProperty(PropertyName = "d_errors_c2", NullValueHandling = NullValueHandling.Ignore)]
public string? C2ErrorsCount { get; set; }
public object Clone()
{
return new DumpingInfoSection
{
FrontendVersion = this.FrontendVersion,
DumpingProgram = this.DumpingProgram,
DumpingDate = this.DumpingDate,
Manufacturer = this.Manufacturer,
Model = this.Model,
Firmware = this.Firmware,
ReportedDiscType = this.ReportedDiscType,
C2ErrorsCount = this.C2ErrorsCount,
};
}
}

View File

@@ -35,12 +35,14 @@
// Automatic Information
public const string FrontendVersionField = "Frontend Version";
public const string DumpingProgramField = "Dumping Program";
public const string DumpingDateField = "Date";
public const string DumpingDriveManufacturer = "Manufacturer";
public const string DumpingDriveModel = "Model";
public const string DumpingDriveFirmware = "Firmware";
public const string ReportedDiscType = "Reported Disc Type";
public const string C2ErrorCountField = "C2 Error Count";
public const string PVDField = "Primary Volume Descriptor (PVD)";
public const string DATField = "DAT";
public const string SizeField = "Size";

View File

@@ -229,12 +229,14 @@ namespace SabreTools.RedumpLib
// Dumping Info section
output.Add(""); output.Add("Dumping Info:");
AddIfExists(output, Template.FrontendVersionField, info.DumpingInfo?.FrontendVersion, 1);
AddIfExists(output, Template.DumpingProgramField, info.DumpingInfo?.DumpingProgram, 1);
AddIfExists(output, Template.DumpingDateField, info.DumpingInfo?.DumpingDate, 1);
AddIfExists(output, Template.DumpingDriveManufacturer, info.DumpingInfo?.Manufacturer, 1);
AddIfExists(output, Template.DumpingDriveModel, info.DumpingInfo?.Model, 1);
AddIfExists(output, Template.DumpingDriveFirmware, info.DumpingInfo?.Firmware, 1);
AddIfExists(output, Template.ReportedDiscType, info.DumpingInfo?.ReportedDiscType, 1);
AddIfExists(output, Template.C2ErrorCountField, info.DumpingInfo?.C2ErrorsCount, 1);
// Make sure there aren't any instances of two blank lines in a row
string? last = null;
@@ -562,8 +564,6 @@ namespace SabreTools.RedumpLib
if (tags.ContainsKey(SiteCode.BBFCRegistrationNumber))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.BBFCRegistrationNumber, tags[SiteCode.BBFCRegistrationNumber]));
if (tags.ContainsKey(SiteCode.CDProjektID))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.CDProjektID, tags[SiteCode.CDProjektID]));
if (tags.ContainsKey(SiteCode.DiscHologramID))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.DiscHologramID, tags[SiteCode.DiscHologramID]));
if (tags.ContainsKey(SiteCode.DNASDiscID))
@@ -577,6 +577,8 @@ namespace SabreTools.RedumpLib
if (tags.ContainsKey(SiteCode.VFCCode))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.VFCCode, tags[SiteCode.VFCCode]));
if (tags.ContainsKey(SiteCode.CompatibleOS))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.CompatibleOS, tags[SiteCode.CompatibleOS]));
if (tags.ContainsKey(SiteCode.Genre))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.Genre, tags[SiteCode.Genre]));
if (tags.ContainsKey(SiteCode.Series))
@@ -593,6 +595,12 @@ namespace SabreTools.RedumpLib
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.ActivisionID, tags[SiteCode.ActivisionID]));
if (tags.ContainsKey(SiteCode.BandaiID))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.BandaiID, tags[SiteCode.BandaiID]));
if (tags.ContainsKey(SiteCode.BethesdaID))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.BethesdaID, tags[SiteCode.BethesdaID]));
if (tags.ContainsKey(SiteCode.CDProjektID))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.CDProjektID, tags[SiteCode.CDProjektID]));
if (tags.ContainsKey(SiteCode.EidosID))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.EidosID, tags[SiteCode.EidosID]));
if (tags.ContainsKey(SiteCode.ElectronicArtsID))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.ElectronicArtsID, tags[SiteCode.ElectronicArtsID]));
if (tags.ContainsKey(SiteCode.FoxInteractiveID))
@@ -649,6 +657,10 @@ namespace SabreTools.RedumpLib
if (tags == null || tags.Count == 0)
return sorted;
// Applications
if (tags.ContainsKey(SiteCode.Applications))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.Applications, tags[SiteCode.Applications]));
// Games
if (tags.ContainsKey(SiteCode.Games))
sorted.Add(new KeyValuePair<SiteCode?, string>(SiteCode.Games, tags[SiteCode.Games]));

View File

@@ -7,12 +7,12 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.3.2</Version>
<Version>1.3.8</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
<Description>Code to interact with redump.org</Description>
<Copyright>Copyright (c) Matt Nadareski 2020-2023</Copyright>
<Copyright>Copyright (c) Matt Nadareski 2020-2024</Copyright>
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SabreTools/SabreTools.RedumpLib</RepositoryUrl>
@@ -40,7 +40,7 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="SabreTools.Models" Version="1.3.0" />
<PackageReference Include="SabreTools.Models" Version="1.4.8" />
</ItemGroup>
</Project>