Compare commits

..

3 Commits
1.9.1 ... main

Author SHA1 Message Date
Matt Nadareski
30789237f1 Formatting cleanup 2026-02-02 09:14:27 -05:00
Deterous
0b309e1cb8 Return empty list for no ID matches (#14)
* Return empty list for no ID matches

* fix

* Deal with null
2026-02-02 09:02:39 -05:00
Matt Nadareski
e832723b40 Add Psion as non-redump system 2026-01-29 12:27:26 -05:00
7 changed files with 31 additions and 8 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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);

View File

@@ -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)

View File

@@ -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

View File

@@ -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;

View File

@@ -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;