From ee4586861f3d8d8b1403d5ff95a9c576ccdde72a Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Tue, 19 Mar 2024 11:29:46 -0400 Subject: [PATCH] fix mega download also added a log line for exceptions --- SPTInstaller/Helpers/DownloadCacheHelper.cs | 2 ++ .../Models/Mirrors/Downloaders/MegaMirrorDownloader.cs | 4 +++- SPTInstaller/SPTInstaller.csproj | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/SPTInstaller/Helpers/DownloadCacheHelper.cs b/SPTInstaller/Helpers/DownloadCacheHelper.cs index d1af78f..b6b318b 100644 --- a/SPTInstaller/Helpers/DownloadCacheHelper.cs +++ b/SPTInstaller/Helpers/DownloadCacheHelper.cs @@ -139,6 +139,8 @@ public static class DownloadCacheHelper } patcherFileStream.Close(); + + outputFile.Refresh(); if (!outputFile.Exists) { diff --git a/SPTInstaller/Models/Mirrors/Downloaders/MegaMirrorDownloader.cs b/SPTInstaller/Models/Mirrors/Downloaders/MegaMirrorDownloader.cs index fb79e35..23212dd 100644 --- a/SPTInstaller/Models/Mirrors/Downloaders/MegaMirrorDownloader.cs +++ b/SPTInstaller/Models/Mirrors/Downloaders/MegaMirrorDownloader.cs @@ -1,6 +1,7 @@ using CG.Web.MegaApiClient; using SPTInstaller.Helpers; using System.Threading.Tasks; +using Serilog; namespace SPTInstaller.Models.Mirrors.Downloaders; public class MegaMirrorDownloader : MirrorDownloaderBase @@ -29,8 +30,9 @@ public class MegaMirrorDownloader : MirrorDownloaderBase return FileHashHelper.CheckHash(file, MirrorInfo.Hash) ? file : null; } - catch + catch(Exception ex) { + Log.Error(ex, "Exception thrown while downloading from mega"); //most likely a 509 (Bandwidth limit exceeded) due to mega's user quotas. return null; } diff --git a/SPTInstaller/SPTInstaller.csproj b/SPTInstaller/SPTInstaller.csproj index f1ea53e..86aab8f 100644 --- a/SPTInstaller/SPTInstaller.csproj +++ b/SPTInstaller/SPTInstaller.csproj @@ -9,8 +9,8 @@ icon.ico Assets\icon.ico Debug;Release;TEST - 2.30 - 2.30 + 2.31 + 2.31 SPT-AKI