mirror of
https://github.com/SabreTools/SabreTools.RedumpLib.git
synced 2026-02-04 13:45:39 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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