diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b27182f..3e2ee116 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Changelog +#### Version - 2.5.3.20 - 6/8/2022 +* Improve reliability of MediaFire, Mega and GDrive downloaders + #### Version - 2.5.3.19 - 6/4/2022 * Fix a potential long standing problem with hash caching diff --git a/Wabbajack.CLI/Program.cs b/Wabbajack.CLI/Program.cs index bd9e48b3..5050ff1c 100644 --- a/Wabbajack.CLI/Program.cs +++ b/Wabbajack.CLI/Program.cs @@ -78,6 +78,7 @@ internal class Program services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); }).Build(); diff --git a/Wabbajack.CLI/Verbs/HashUrlString.cs b/Wabbajack.CLI/Verbs/HashUrlString.cs new file mode 100644 index 00000000..a6905374 --- /dev/null +++ b/Wabbajack.CLI/Verbs/HashUrlString.cs @@ -0,0 +1,34 @@ +using System.CommandLine; +using System.CommandLine.Invocation; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Wabbajack.Hashing.xxHash64; +using Wabbajack.Paths; + +namespace Wabbajack.CLI.Verbs; + +public class HashUrlString : IVerb +{ + private readonly ILogger _logger; + + public HashUrlString(ILogger logger) + { + _logger = logger; + } + + public Command MakeCommand() + { + var command = new Command("hash-url-string"); + command.Add(new Option(new[] {"-u", "-url"}, "Url string to hash")); + command.Description = "Hashes a URL string and returns the hashcode as hex"; + command.Handler = CommandHandler.Create(Run); + return command; + } + + + public async Task Run(string u) + { + _logger.LogInformation("Hash: {Hash}", (await u.Hash()).ToHex()); + return 0; + } +} \ No newline at end of file diff --git a/Wabbajack.Server/Controllers/Proxy.cs b/Wabbajack.Server/Controllers/Proxy.cs index eb3736b8..88725678 100644 --- a/Wabbajack.Server/Controllers/Proxy.cs +++ b/Wabbajack.Server/Controllers/Proxy.cs @@ -73,7 +73,8 @@ public class Proxy : ControllerBase } catch (Exception ex) { - _logger.LogInformation("When trying to verify cached file"); + _logger.LogInformation(ex, "When trying to verify cached file ({Hash}) {Url}", cacheFile.FileName, uri); + cacheFile.Touch(); } }