mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Optimized image downloading
This commit is contained in:
parent
c1b5b1cef1
commit
ebfd78e051
@ -460,12 +460,15 @@ namespace Wabbajack
|
||||
private void CacheSlide(string url, string dest)
|
||||
{
|
||||
bool sync = false;
|
||||
dispatcher.Invoke(() => {
|
||||
var file = new FileStream(dest, FileMode.Create, FileAccess.Write);
|
||||
using (var file = new FileStream(dest, FileMode.Create, FileAccess.Write))
|
||||
{
|
||||
if (sync)
|
||||
{
|
||||
using (var stream = new HttpClient().GetStreamSync(url))
|
||||
stream.CopyTo(file);
|
||||
dispatcher.Invoke(() =>
|
||||
{
|
||||
using (var stream = new HttpClient().GetStreamSync(url))
|
||||
stream.CopyTo(file);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -473,9 +476,9 @@ namespace Wabbajack
|
||||
{
|
||||
stream.Wait();
|
||||
stream.Result.CopyTo(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Queues a random slide
|
||||
|
Loading…
Reference in New Issue
Block a user