Few updates for the proxy

This commit is contained in:
Timothy Baldridge 2022-06-09 06:14:21 -06:00
parent ca74e79348
commit 3657c6a4ba
4 changed files with 40 additions and 1 deletions

View File

@ -1,5 +1,8 @@
### Changelog ### 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 #### Version - 2.5.3.19 - 6/4/2022
* Fix a potential long standing problem with hash caching * Fix a potential long standing problem with hash caching

View File

@ -78,6 +78,7 @@ internal class Program
services.AddSingleton<IVerb, DumpZipInfo>(); services.AddSingleton<IVerb, DumpZipInfo>();
services.AddSingleton<IVerb, Install>(); services.AddSingleton<IVerb, Install>();
services.AddSingleton<IVerb, InstallCompileInstallVerify>(); services.AddSingleton<IVerb, InstallCompileInstallVerify>();
services.AddSingleton<IVerb, HashUrlString>();
services.AddSingleton<IUserInterventionHandler, UserInterventionHandler>(); services.AddSingleton<IUserInterventionHandler, UserInterventionHandler>();
}).Build(); }).Build();

View File

@ -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<HashUrlString> _logger;
public HashUrlString(ILogger<HashUrlString> logger)
{
_logger = logger;
}
public Command MakeCommand()
{
var command = new Command("hash-url-string");
command.Add(new Option<AbsolutePath>(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<int> Run(string u)
{
_logger.LogInformation("Hash: {Hash}", (await u.Hash()).ToHex());
return 0;
}
}

View File

@ -73,7 +73,8 @@ public class Proxy : ControllerBase
} }
catch (Exception ex) 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();
} }
} }