mirror of
https://github.com/SabreTools/SabreTools.RedumpLib.git
synced 2026-02-06 13:47:35 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a9d639824 | ||
|
|
30789237f1 | ||
|
|
0b309e1cb8 | ||
|
|
e832723b40 |
@@ -1298,6 +1298,7 @@ namespace SabreTools.RedumpLib.Test.Data
|
||||
[RedumpSystem.PhotoCD] = SystemCategory.Other,
|
||||
[RedumpSystem.PlayStationGameSharkUpdates] = SystemCategory.Other,
|
||||
[RedumpSystem.PocketPC] = SystemCategory.Other,
|
||||
[RedumpSystem.Psion] = SystemCategory.Other,
|
||||
[RedumpSystem.RainbowDisc] = SystemCategory.Other,
|
||||
[RedumpSystem.SegaPrologue21MultimediaKaraokeSystem] = SystemCategory.Other,
|
||||
[RedumpSystem.SharpZaurus] = SystemCategory.Other,
|
||||
@@ -1646,6 +1647,7 @@ namespace SabreTools.RedumpLib.Test.Data
|
||||
RedumpSystem.PalmOS,
|
||||
RedumpSystem.PhotoCD,
|
||||
RedumpSystem.PocketPC,
|
||||
RedumpSystem.Psion,
|
||||
RedumpSystem.RainbowDisc,
|
||||
RedumpSystem.SharpZaurus,
|
||||
RedumpSystem.SegaPrologue21MultimediaKaraokeSystem,
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace SabreTools.RedumpLib.Test
|
||||
[Fact]
|
||||
public void FormatOutputData_TAWOInvalid_Minimal()
|
||||
{
|
||||
string expected = "Tracks and Write Offsets:\n\tDAT:\n\n\n\n\n";
|
||||
string expected = "Tracks and Write Offsets:\n\tClrMamePro Data (DAT):\n\n\n\n\n";
|
||||
|
||||
var builder = new StringBuilder();
|
||||
TracksAndWriteOffsetsSection? section = new();
|
||||
@@ -295,7 +295,7 @@ namespace SabreTools.RedumpLib.Test
|
||||
[Fact]
|
||||
public void FormatOutputData_TAWO_Formatted()
|
||||
{
|
||||
string expected = "Tracks and Write Offsets:\n\tDAT:\n\nXXXXXX\n\n\n\tCuesheet: XXXXXX\n\tWrite Offset: XXXXXX\n";
|
||||
string expected = "Tracks and Write Offsets:\n\tClrMamePro Data (DAT):\n\nXXXXXX\n\n\n\tCuesheet: XXXXXX\n\tWrite Offset: XXXXXX\n";
|
||||
|
||||
var builder = new StringBuilder();
|
||||
TracksAndWriteOffsetsSection? section = new()
|
||||
|
||||
@@ -2467,6 +2467,9 @@ namespace SabreTools.RedumpLib.Data
|
||||
[System(Category = SystemCategory.Other, LongName = "Pocket PC", ShortName = "ppc", HasCues = true, HasDat = true)]
|
||||
PocketPC,
|
||||
|
||||
[System(Category = SystemCategory.Other, Available = false, LongName = "Psion")]
|
||||
Psion,
|
||||
|
||||
[System(Category = SystemCategory.Other, Available = false, LongName = "Rainbow Disc")]
|
||||
RainbowDisc,
|
||||
|
||||
|
||||
@@ -722,6 +722,11 @@ namespace SabreTools.RedumpLib.Data
|
||||
types.Add(MediaType.CDROM);
|
||||
break;
|
||||
|
||||
// UNKNOWN
|
||||
case RedumpSystem.Psion:
|
||||
types.Add(MediaType.CDROM);
|
||||
break;
|
||||
|
||||
// https://en.wikipedia.org/wiki/Doors_and_Windows_(EP)
|
||||
case RedumpSystem.RainbowDisc:
|
||||
types.Add(MediaType.CDROM);
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
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 DATField = "ClrMamePro Data (DAT)";
|
||||
public const string SizeField = "Size";
|
||||
public const string CRC32Field = "CRC32";
|
||||
public const string MD5Field = "MD5";
|
||||
|
||||
@@ -110,7 +110,10 @@ namespace SabreTools.RedumpLib
|
||||
int pageNumber = 1;
|
||||
while (true)
|
||||
{
|
||||
List<int> pageIds = await rc.CheckSingleSitePage(string.Format(Constants.QuickSearchUrl, query, pageNumber++));
|
||||
List<int>? pageIds = await rc.CheckSingleSitePage(string.Format(Constants.QuickSearchUrl, query, pageNumber++));
|
||||
if (pageIds is null)
|
||||
return null;
|
||||
|
||||
ids.AddRange(pageIds);
|
||||
if (pageIds.Count <= 1)
|
||||
break;
|
||||
@@ -141,9 +144,9 @@ namespace SabreTools.RedumpLib
|
||||
if (newIds is null)
|
||||
return null;
|
||||
|
||||
// If no IDs match, just return
|
||||
// If no IDs match, return an empty list
|
||||
if (newIds.Count == 0)
|
||||
return null;
|
||||
return [];
|
||||
|
||||
// Join the list of found IDs to the existing list, if possible
|
||||
if (info.PartiallyMatchedIDs is not null && info.PartiallyMatchedIDs.Count > 0)
|
||||
@@ -185,9 +188,9 @@ namespace SabreTools.RedumpLib
|
||||
if (newIds is null)
|
||||
return null;
|
||||
|
||||
// If no IDs match, just return
|
||||
// If no IDs match, just an empty list
|
||||
if (newIds.Count == 0)
|
||||
return null;
|
||||
return [];
|
||||
|
||||
// Join the list of found IDs to the existing list, if possible
|
||||
if (info.PartiallyMatchedIDs is not null && info.PartiallyMatchedIDs.Count > 0)
|
||||
|
||||
@@ -299,15 +299,19 @@ namespace SabreTools.RedumpLib.Web
|
||||
/// </summary>
|
||||
/// <param name="url">Base URL to download using</param>
|
||||
/// <returns>List of IDs from the page, empty on error</returns>
|
||||
public async Task<List<int>> CheckSingleSitePage(string url)
|
||||
public async Task<List<int>?> CheckSingleSitePage(string url)
|
||||
{
|
||||
List<int> ids = [];
|
||||
|
||||
// Try to retrieve the data
|
||||
string? dumpsPage = await DownloadString(url);
|
||||
|
||||
// If the web client failed, return null
|
||||
if (dumpsPage is null)
|
||||
return null;
|
||||
|
||||
// If we have no dumps left
|
||||
if (dumpsPage is null || dumpsPage.Contains("No discs found."))
|
||||
if (dumpsPage.Contains("No discs found."))
|
||||
return ids;
|
||||
|
||||
// If we have a single disc page already
|
||||
|
||||
@@ -43,7 +43,10 @@ namespace SabreTools.RedumpLib.Web
|
||||
int pageNumber = 1;
|
||||
while (true)
|
||||
{
|
||||
List<int> pageIds = await rc.CheckSingleSitePage(string.Format(Constants.QuickSearchUrl, query, pageNumber++));
|
||||
var pageIds = await rc.CheckSingleSitePage(string.Format(Constants.QuickSearchUrl, query, pageNumber++));
|
||||
if (pageIds is null)
|
||||
return [];
|
||||
|
||||
ids.AddRange(pageIds);
|
||||
if (pageIds.Count <= 1)
|
||||
break;
|
||||
|
||||
@@ -93,6 +93,9 @@ namespace SabreTools.RedumpLib.Web
|
||||
while (true)
|
||||
{
|
||||
var pageIds = await rc.CheckSingleSitePage(string.Format(Constants.UserDumpsUrl, username, pageNumber++));
|
||||
if (pageIds is null)
|
||||
return [];
|
||||
|
||||
ids.AddRange(pageIds);
|
||||
if (pageIds.Count <= 1)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user