From a0ebc87b7c16bbdcac53a8aef58984ef32e07a78 Mon Sep 17 00:00:00 2001 From: Macocian Alexandru Victor Date: Tue, 27 Feb 2024 15:08:02 +0100 Subject: [PATCH] Release 0.9.9.21 (#609) Fix updater packaging logic --- Daybreak/Daybreak.csproj | 2 +- Daybreak/Services/Updater/ApplicationUpdater.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Daybreak/Daybreak.csproj b/Daybreak/Daybreak.csproj index 29fb6dca..efa1bb1c 100644 --- a/Daybreak/Daybreak.csproj +++ b/Daybreak/Daybreak.csproj @@ -11,7 +11,7 @@ preview Daybreak.ico true - 0.9.9.20 + 0.9.9.21 true cfb2a489-db80-448d-a969-80270f314c46 True diff --git a/Daybreak/Services/Updater/ApplicationUpdater.cs b/Daybreak/Services/Updater/ApplicationUpdater.cs index ffbb456e..939e03fc 100644 --- a/Daybreak/Services/Updater/ApplicationUpdater.cs +++ b/Daybreak/Services/Updater/ApplicationUpdater.cs @@ -268,7 +268,7 @@ private async Task DownloadUpdateInternalBlob(List metadata, Ver using var packageStream = new FileStream("update.pkg", FileMode.Create); var downloaded = 0d; - var downloadBuffer = new Memory(new byte[8192]); + var downloadBuffer = new byte[8192]; var sizeToDownload = (double)filesToDownload.Sum(m => m.Size); var sw = Stopwatch.StartNew(); var lastUpdate = DateTime.Now; @@ -318,8 +318,8 @@ private async Task DownloadUpdateInternalBlob(List metadata, Ver var fileSize = file.Size; while (fileSize > 0) { - var readBytes = await downloadStream.ReadAsync(downloadBuffer); - await packageStream.WriteAsync(downloadBuffer); + var readBytes = await downloadStream.ReadAsync(downloadBuffer, 0, downloadBuffer.Length); + await packageStream.WriteAsync(downloadBuffer, 0, readBytes); fileSize -= readBytes; downloaded += readBytes;