mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added a/sync options to caching
This commit is contained in:
parent
125cb3c2a9
commit
735f8d6889
@ -398,10 +398,23 @@ namespace Wabbajack
|
||||
/// <param name="dest">The destination</param>
|
||||
private void CacheSlide(string url, string dest)
|
||||
{
|
||||
bool sync = false;
|
||||
dispatcher.Invoke(() => {
|
||||
var file = new FileStream(dest, FileMode.Create, FileAccess.Write);
|
||||
using (var stream = new HttpClient().GetStreamSync(url))
|
||||
stream.CopyTo(file);
|
||||
if (sync)
|
||||
{
|
||||
using (var stream = new HttpClient().GetStreamSync(url))
|
||||
stream.CopyTo(file);
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var stream = new HttpClient().GetStreamAsync(url))
|
||||
{
|
||||
stream.Wait();
|
||||
stream.Result.CopyTo(file);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user