diff --git a/SabreTools.RedumpLib/Web/Discs.cs b/SabreTools.RedumpLib/Web/Discs.cs index 8bdc98a..7ce3cc1 100644 --- a/SabreTools.RedumpLib/Web/Discs.cs +++ b/SabreTools.RedumpLib/Web/Discs.cs @@ -147,6 +147,35 @@ namespace SabreTools.RedumpLib.Web return ids; } + /// + /// Download the specified set of site disc pages + /// + /// RedumpClient for connectivity + /// Set of site IDs to download + /// Output directory to save data to + /// True to force all downloads, false otherwise + /// Force continuation of download + /// All disc IDs that successfully downloaded, empty on error + public static async Task> DownloadSiteSet(this RedumpClient client, + List siteIds, + string? outDir, + bool forceDownload, + bool forceContinue) + { + List 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; + } + /// /// Download the specified range of site disc pages /// @@ -156,7 +185,7 @@ namespace SabreTools.RedumpLib.Web /// Force continuation of download /// Starting ID for the range /// Ending ID for the range (inclusive) - /// All disc IDs in last modified range, empty on error + /// All disc IDs that successfully downloaded, empty on error public static async Task> DownloadSiteRange(this RedumpClient client, string? outDir, bool forceDownload, diff --git a/SabreTools.RedumpLib/Web/WIP.cs b/SabreTools.RedumpLib/Web/WIP.cs index 94f64cc..ebe872a 100644 --- a/SabreTools.RedumpLib/Web/WIP.cs +++ b/SabreTools.RedumpLib/Web/WIP.cs @@ -22,6 +22,30 @@ namespace SabreTools.RedumpLib.Web return await client.CheckSingleWIPPage(Constants.WipDumpsUrl, outDir, forceDownload, forceContinue) ?? []; } + /// + /// Download the specified range of WIP disc pages + /// + /// RedumpClient for connectivity + /// Set of WIP IDs to download + /// Output directory to save data to + /// True to force all downloads, false otherwise + /// All WIP IDs in last submitted range, empty on error + public static async Task> DownloadWIPSet(this RedumpClient client, List wipIds, string? outDir, bool forceDownload) + { + List 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; + } + /// /// Download the specified range of WIP disc pages /// @@ -30,8 +54,12 @@ namespace SabreTools.RedumpLib.Web /// True to force all downloads, false otherwise /// Starting ID for the range /// Ending ID for the range (inclusive) - /// All disc IDs in last submitted range, empty on error - public static async Task> DownloadWIPRange(this RedumpClient client, string? outDir, bool forceDownload, int minId = 0, int maxId = 0) + /// All WIP IDs that successfully downloaded, empty on error + public static async Task> DownloadWIPRange(this RedumpClient client, + string? outDir, + bool forceDownload, + int minId = 0, + int maxId = 0) { List ids = []; for (int id = minId; id <= maxId; id++)