mirror of
https://github.com/SabreTools/SabreTools.RedumpLib.git
synced 2026-09-23 07:24:52 +00:00
Add set download library methods
This commit is contained in:
@@ -147,6 +147,35 @@ namespace SabreTools.RedumpLib.Web
|
||||
return ids;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download the specified set of site disc pages
|
||||
/// </summary>
|
||||
/// <param name="client">RedumpClient for connectivity</param>
|
||||
/// <param name="siteIds">Set of site IDs to download</param>
|
||||
/// <param name="outDir">Output directory to save data to</param>
|
||||
/// <param name="forceDownload">True to force all downloads, false otherwise</param>
|
||||
/// <param name="forceContinue">Force continuation of download</param>
|
||||
/// <returns>All disc IDs that successfully downloaded, empty on error</returns>
|
||||
public static async Task<List<int>> DownloadSiteSet(this RedumpClient client,
|
||||
List<int> siteIds,
|
||||
string? outDir,
|
||||
bool forceDownload,
|
||||
bool forceContinue)
|
||||
{
|
||||
List<int> ids = [];
|
||||
foreach (int id in siteIds)
|
||||
{
|
||||
bool downloaded = await client.DownloadSingleSiteID(id, outDir, rename: true, forceDownload, forceContinue);
|
||||
if (downloaded)
|
||||
{
|
||||
ids.Add(id);
|
||||
DelayHelper.DelayRandom();
|
||||
}
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download the specified range of site disc pages
|
||||
/// </summary>
|
||||
@@ -156,7 +185,7 @@ namespace SabreTools.RedumpLib.Web
|
||||
/// <param name="forceContinue">Force continuation of download</param>
|
||||
/// <param name="minId">Starting ID for the range</param>
|
||||
/// <param name="maxId">Ending ID for the range (inclusive)</param>
|
||||
/// <returns>All disc IDs in last modified range, empty on error</returns>
|
||||
/// <returns>All disc IDs that successfully downloaded, empty on error</returns>
|
||||
public static async Task<List<int>> DownloadSiteRange(this RedumpClient client,
|
||||
string? outDir,
|
||||
bool forceDownload,
|
||||
|
||||
@@ -22,6 +22,30 @@ namespace SabreTools.RedumpLib.Web
|
||||
return await client.CheckSingleWIPPage(Constants.WipDumpsUrl, outDir, forceDownload, forceContinue) ?? [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download the specified range of WIP disc pages
|
||||
/// </summary>
|
||||
/// <param name="client">RedumpClient for connectivity</param>
|
||||
/// <param name="wipIds">Set of WIP IDs to download</param>
|
||||
/// <param name="outDir">Output directory to save data to</param>
|
||||
/// <param name="forceDownload">True to force all downloads, false otherwise</param>
|
||||
/// <returns>All WIP IDs in last submitted range, empty on error</returns>
|
||||
public static async Task<List<int>> DownloadWIPSet(this RedumpClient client, List<int> wipIds, string? outDir, bool forceDownload)
|
||||
{
|
||||
List<int> ids = [];
|
||||
foreach (int id in wipIds)
|
||||
{
|
||||
bool downloaded = await client.DownloadSingleWIPID(id, outDir, rename: true, forceDownload);
|
||||
if (downloaded)
|
||||
{
|
||||
ids.Add(id);
|
||||
DelayHelper.DelayRandom();
|
||||
}
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download the specified range of WIP disc pages
|
||||
/// </summary>
|
||||
@@ -30,8 +54,12 @@ namespace SabreTools.RedumpLib.Web
|
||||
/// <param name="forceDownload">True to force all downloads, false otherwise</param>
|
||||
/// <param name="minId">Starting ID for the range</param>
|
||||
/// <param name="maxId">Ending ID for the range (inclusive)</param>
|
||||
/// <returns>All disc IDs in last submitted range, empty on error</returns>
|
||||
public static async Task<List<int>> DownloadWIPRange(this RedumpClient client, string? outDir, bool forceDownload, int minId = 0, int maxId = 0)
|
||||
/// <returns>All WIP IDs that successfully downloaded, empty on error</returns>
|
||||
public static async Task<List<int>> DownloadWIPRange(this RedumpClient client,
|
||||
string? outDir,
|
||||
bool forceDownload,
|
||||
int minId = 0,
|
||||
int maxId = 0)
|
||||
{
|
||||
List<int> ids = [];
|
||||
for (int id = minId; id <= maxId; id++)
|
||||
|
||||
Reference in New Issue
Block a user