mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 19:37:23 +01:00
reduce linq usage for download transferred bytes
This commit is contained in:
parent
189da9201b
commit
189ec03173
2 changed files with 2 additions and 5 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.5.10</Version>
|
||||
<Version>0.5.11</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||
|
|
|
|||
|
|
@ -120,10 +120,7 @@ public partial class ApiController
|
|||
var hash = file.Hash;
|
||||
Progress<long> progress = new((bytesDownloaded) =>
|
||||
{
|
||||
if (!CurrentDownloads.TryGetValue(currentDownloadId, out var downloads)) return;
|
||||
|
||||
var download = downloads.FirstOrDefault(f => string.Equals(f.Hash, hash, StringComparison.OrdinalIgnoreCase));
|
||||
if (download != null) download.Transferred += bytesDownloaded;
|
||||
file.Transferred += bytesDownloaded;
|
||||
});
|
||||
|
||||
var tempFile = await DownloadFileHttpClient(file.DownloadUri, progress, token).ConfigureAwait(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue