diff --git a/SabreTools.RedumpLib/Web/RedumpClient.cs b/SabreTools.RedumpLib/Web/RedumpClient.cs index 2019612..a2fff77 100644 --- a/SabreTools.RedumpLib/Web/RedumpClient.cs +++ b/SabreTools.RedumpLib/Web/RedumpClient.cs @@ -36,7 +36,12 @@ namespace SabreTools.RedumpLib.Web /// /// Maximum retry count for any operation /// - public int RetryCount { get; } + /// Value has to be greater than 0 + public int RetryCount + { + get; + set { field = value < 0 ? 3 : value; } + } = 3; /// /// Internal client for interaction @@ -52,18 +57,12 @@ namespace SabreTools.RedumpLib.Web /// /// Constructor /// - public RedumpClient(int timeoutSeconds = 30, int retryCount = 3) + public RedumpClient(int timeoutSeconds = 30) { - // Ensure there are a positive number of retries - if (retryCount <= 0) - retryCount = 3; - // Ensure a positive timespan if (timeoutSeconds <= 0) timeoutSeconds = 30; - RetryCount = retryCount; - #if NETFRAMEWORK || NETSTANDARD2_0_OR_GREATER _internalClient = new CookieWebClient() { Timeout = TimeSpan.FromSeconds(timeoutSeconds) }; #else @@ -74,18 +73,12 @@ namespace SabreTools.RedumpLib.Web /// /// Constructor /// - public RedumpClient(TimeSpan timeout, int retryCount = 3) + public RedumpClient(TimeSpan timeout) { - // Ensure there are a positive number of retries - if (retryCount <= 0) - retryCount = 3; - // Ensure a positive timespan if (timeout <= TimeSpan.Zero) timeout = TimeSpan.FromSeconds(30); - RetryCount = retryCount; - #if NETFRAMEWORK || NETSTANDARD2_0_OR_GREATER _internalClient = new CookieWebClient() { Timeout = timeout }; #else