mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Few updates for the proxy
This commit is contained in:
parent
ca74e79348
commit
3657c6a4ba
@ -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
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
34
Wabbajack.CLI/Verbs/HashUrlString.cs
Normal file
34
Wabbajack.CLI/Verbs/HashUrlString.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user