diff --git a/RedumpTool/Features/BaseFeature.cs b/RedumpTool/Features/BaseFeature.cs index 37e1f70..ee7f155 100644 --- a/RedumpTool/Features/BaseFeature.cs +++ b/RedumpTool/Features/BaseFeature.cs @@ -123,7 +123,7 @@ namespace RedumpTool.Features /// /// redump.info client to use for external connections /// - protected SabreTools.RedumpLib.RedumpInfo.Client _infoClient; + protected SabreTools.RedumpLib.Web.Client _client; /// /// redump.org client to use for external connections @@ -135,7 +135,7 @@ namespace RedumpTool.Features public BaseFeature(string name, string[] flags, string description, string? detailed = null) : base(name, flags, description, detailed) { - _infoClient = new SabreTools.RedumpLib.RedumpInfo.Client(); + _client = new SabreTools.RedumpLib.Web.Client(); _orgClient = new SabreTools.RedumpLib.RedumpOrg.Client(); } diff --git a/RedumpTool/Features/PacksFeature.cs b/RedumpTool/Features/PacksFeature.cs index 7259a0b..9e2ce85 100644 --- a/RedumpTool/Features/PacksFeature.cs +++ b/RedumpTool/Features/PacksFeature.cs @@ -89,19 +89,19 @@ namespace RedumpTool.Features else { // Update redump.info client properties - _infoClient.Debug = DebugInput.Value; + _client.Debug = DebugInput.Value; if (attemptCount != null && attemptCount > 0) - _infoClient.AttemptCount = attemptCount.Value; + _client.AttemptCount = attemptCount.Value; if (timeout != null && timeout > 0) - _infoClient.Timeout = TimeSpan.FromSeconds(timeout.Value); - _infoClient.Overwrite = forceDownload; - _infoClient.IgnoreErrors = forceContinue; + _client.Timeout = TimeSpan.FromSeconds(timeout.Value); + _client.Overwrite = forceDownload; + _client.IgnoreErrors = forceContinue; // Login to redump.info, if necessary - _infoClient.Login(username, password).Wait(); + _client.Login(username, password).Wait(); // Start the processing - var processingTask = _infoClient.DownloadAllPacks(outDir, useSubfolders); + var processingTask = _client.DownloadAllPacks(outDir, useSubfolders); // Retrieve the result processingTask.Wait(); diff --git a/RedumpTool/Features/QueryFeature.cs b/RedumpTool/Features/QueryFeature.cs index 1fc932a..06ebd73 100644 --- a/RedumpTool/Features/QueryFeature.cs +++ b/RedumpTool/Features/QueryFeature.cs @@ -141,23 +141,23 @@ namespace RedumpTool.Features else { // Update redump.info client properties - _infoClient.Debug = DebugInput.Value; + _client.Debug = DebugInput.Value; if (attemptCount != null && attemptCount > 0) - _infoClient.AttemptCount = attemptCount.Value; + _client.AttemptCount = attemptCount.Value; if (timeout != null && timeout > 0) - _infoClient.Timeout = TimeSpan.FromSeconds(timeout.Value); - _infoClient.Overwrite = forceDownload; - _infoClient.IgnoreErrors = forceContinue; + _client.Timeout = TimeSpan.FromSeconds(timeout.Value); + _client.Overwrite = forceDownload; + _client.IgnoreErrors = forceContinue; // Login to edump.info, if necessary - _infoClient.Login(username, password).Wait(); + _client.Login(username, password).Wait(); // Start the processing Task> processingTask; if (onlyList) - processingTask = _infoClient.ListDiscsResults(quicksearch: query, limit: limit); + processingTask = _client.ListDiscsResults(quicksearch: query, limit: limit); else - processingTask = _infoClient.DownloadDiscsResults(outDir, quicksearch: query, limit: limit, discSubpaths: discSubpaths); + processingTask = _client.DownloadDiscsResults(outDir, quicksearch: query, limit: limit, discSubpaths: discSubpaths); // Retrieve the result processingTask.Wait(); diff --git a/RedumpTool/Features/SiteFeature.cs b/RedumpTool/Features/SiteFeature.cs index ca56557..0add534 100644 --- a/RedumpTool/Features/SiteFeature.cs +++ b/RedumpTool/Features/SiteFeature.cs @@ -244,26 +244,26 @@ namespace RedumpTool.Features else { // Update redump.info client properties - _infoClient.Debug = DebugInput.Value; + _client.Debug = DebugInput.Value; if (attemptCount != null && attemptCount > 0) - _infoClient.AttemptCount = attemptCount.Value; + _client.AttemptCount = attemptCount.Value; if (timeout != null && timeout > 0) - _infoClient.Timeout = TimeSpan.FromSeconds(timeout.Value); - _infoClient.Overwrite = forceDownload; - _infoClient.IgnoreErrors = forceContinue; + _client.Timeout = TimeSpan.FromSeconds(timeout.Value); + _client.Overwrite = forceDownload; + _client.IgnoreErrors = forceContinue; // Login to redump.info, if necessary - _infoClient.Login(username, password).Wait(); + _client.Login(username, password).Wait(); // Start the processing Task> processingTask; if (minId >= 0 && maxId >= 0) { - processingTask = _infoClient.DownloadSiteRange(outDir, minId, maxId, discSubpaths: discSubpaths); + processingTask = _client.DownloadSiteRange(outDir, minId, maxId, discSubpaths: discSubpaths); } else { - processingTask = _infoClient.DownloadDiscsResults(outDir, + processingTask = _client.DownloadDiscsResults(outDir, comments ? quicksearch : null, dumper, edition, diff --git a/RedumpTool/Features/UserFeature.cs b/RedumpTool/Features/UserFeature.cs index f704ecc..67c7970 100644 --- a/RedumpTool/Features/UserFeature.cs +++ b/RedumpTool/Features/UserFeature.cs @@ -136,25 +136,25 @@ namespace RedumpTool.Features else { // Update redump.info client properties - _infoClient.Debug = DebugInput.Value; + _client.Debug = DebugInput.Value; if (attemptCount != null && attemptCount > 0) - _infoClient.AttemptCount = attemptCount.Value; + _client.AttemptCount = attemptCount.Value; if (timeout != null && timeout > 0) - _infoClient.Timeout = TimeSpan.FromSeconds(timeout.Value); - _infoClient.Overwrite = forceDownload; - _infoClient.IgnoreErrors = forceContinue; + _client.Timeout = TimeSpan.FromSeconds(timeout.Value); + _client.Overwrite = forceDownload; + _client.IgnoreErrors = forceContinue; // Login to redump.info, if necessary - _infoClient.Login(username, password).Wait(); + _client.Login(username, password).Wait(); // Start the processing Task> processingTask; if (onlyList) - processingTask = _infoClient.ListDiscsResults(dumper: username, limit: limit); + processingTask = _client.ListDiscsResults(dumper: username, limit: limit); else if (onlyNew) - processingTask = _infoClient.DownloadDiscsResults(outDir, dumper: username, sort: SortCategory.Modified, sortDir: SortDirection.Descending, limit: limit, discSubpaths: discSubpaths); + processingTask = _client.DownloadDiscsResults(outDir, dumper: username, sort: SortCategory.Modified, sortDir: SortDirection.Descending, limit: limit, discSubpaths: discSubpaths); else - processingTask = _infoClient.DownloadDiscsResults(outDir, dumper: username, limit: limit, discSubpaths: discSubpaths); + processingTask = _client.DownloadDiscsResults(outDir, dumper: username, limit: limit, discSubpaths: discSubpaths); // Retrieve the result processingTask.Wait(); diff --git a/RedumpTool/Features/WIPFeature.cs b/RedumpTool/Features/WIPFeature.cs index 4d5d6bb..c7ac20a 100644 --- a/RedumpTool/Features/WIPFeature.cs +++ b/RedumpTool/Features/WIPFeature.cs @@ -115,23 +115,23 @@ namespace RedumpTool.Features else { // Update redump.info properties - _infoClient.Debug = DebugInput.Value; + _client.Debug = DebugInput.Value; if (attemptCount != null && attemptCount > 0) - _infoClient.AttemptCount = attemptCount.Value; + _client.AttemptCount = attemptCount.Value; if (timeout != null && timeout > 0) - _infoClient.Timeout = TimeSpan.FromSeconds(timeout.Value); - _infoClient.Overwrite = forceDownload; - _infoClient.IgnoreErrors = forceContinue; + _client.Timeout = TimeSpan.FromSeconds(timeout.Value); + _client.Overwrite = forceDownload; + _client.IgnoreErrors = forceContinue; // Login to redump.info, if necessary - _infoClient.Login(username, password).Wait(); + _client.Login(username, password).Wait(); // Start the processing Task> processingTask; if (onlyNew) - processingTask = _infoClient.DownloadLastSubmitted(outDir); + processingTask = _client.DownloadLastSubmitted(outDir); else - processingTask = _infoClient.DownloadQueueRange(outDir, minId, maxId); + processingTask = _client.DownloadQueueRange(outDir, minId, maxId); // Retrieve the result processingTask.Wait(); diff --git a/SabreTools.RedumpLib/Builder.cs b/SabreTools.RedumpLib/Builder.cs index 2764177..deaf195 100644 --- a/SabreTools.RedumpLib/Builder.cs +++ b/SabreTools.RedumpLib/Builder.cs @@ -252,12 +252,12 @@ namespace SabreTools.RedumpLib /// /// Fill out an existing SubmissionInfo object based on a disc page /// - /// RedumpClient for making the connection + /// Client for making the connection /// Existing SubmissionInfo object to fill /// Redump disc ID to retrieve /// True to include all pullable information, false to do bare minimum /// TODO: Validate that this code is working - public static async Task FillFromId(RedumpInfo.Client client, SubmissionInfo info, int id, bool includeAllData) + public static async Task FillFromId(Web.Client client, SubmissionInfo info, int id, bool includeAllData) { var discData = await client.DownloadSingleDiscPage(id); if (string.IsNullOrEmpty(discData)) diff --git a/SabreTools.RedumpLib/RedumpInfo/Packs.cs b/SabreTools.RedumpLib/RedumpInfo/Packs.cs index 963b7c7..e71375c 100644 --- a/SabreTools.RedumpLib/RedumpInfo/Packs.cs +++ b/SabreTools.RedumpLib/RedumpInfo/Packs.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using SabreTools.RedumpLib.Data; +using SabreTools.RedumpLib.Web; namespace SabreTools.RedumpLib.RedumpInfo { diff --git a/SabreTools.RedumpLib/RedumpInfo/Validator.cs b/SabreTools.RedumpLib/RedumpInfo/Validator.cs index e9b114f..4fc1d02 100644 --- a/SabreTools.RedumpLib/RedumpInfo/Validator.cs +++ b/SabreTools.RedumpLib/RedumpInfo/Validator.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using SabreTools.RedumpLib.Data; +using SabreTools.RedumpLib.Web; using SubmissionInfo = SabreTools.RedumpLib.RedumpOrg.SubmissionInfo; namespace SabreTools.RedumpLib.RedumpInfo @@ -16,7 +17,7 @@ namespace SabreTools.RedumpLib.RedumpInfo /// List of found values, if possible public static async Task?> ValidateSingleTrack(Client client, SubmissionInfo info, string? sha1) { - // Get all matching IDs for the track + // Get all matching IDs for the trackClient var newIds = await client.ListDiscsResults(quicksearch: sha1); // If we got null back, there was an error diff --git a/SabreTools.RedumpLib/RedumpInfo/Client.cs b/SabreTools.RedumpLib/Web/Client.cs similarity index 99% rename from SabreTools.RedumpLib/RedumpInfo/Client.cs rename to SabreTools.RedumpLib/Web/Client.cs index 2b36e74..7a9df65 100644 --- a/SabreTools.RedumpLib/RedumpInfo/Client.cs +++ b/SabreTools.RedumpLib/Web/Client.cs @@ -10,9 +10,9 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using SabreTools.RedumpLib.Data; -using SabreTools.RedumpLib.Web; +using SabreTools.RedumpLib.RedumpInfo; -namespace SabreTools.RedumpLib.RedumpInfo +namespace SabreTools.RedumpLib.Web { // TODO: Nearly every method here needs to be validated #pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'.