From 9617ca4982c5bea64b2278982afcb1a380b492d0 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Thu, 14 Nov 2019 14:53:29 -0700 Subject: [PATCH] Fix how we clean the download cache (#170) --- .gitignore | 1 + Wabbajack.Lib/Downloaders/NexusDownloader.cs | 10 ++-------- Wabbajack.Test.ListValidation/ListValidation.cs | 16 ++++++++-------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 02139e36..79d51ade 100644 --- a/.gitignore +++ b/.gitignore @@ -365,3 +365,4 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ +/.idea diff --git a/Wabbajack.Lib/Downloaders/NexusDownloader.cs b/Wabbajack.Lib/Downloaders/NexusDownloader.cs index 8c8d8d9b..44747048 100644 --- a/Wabbajack.Lib/Downloaders/NexusDownloader.cs +++ b/Wabbajack.Lib/Downloaders/NexusDownloader.cs @@ -52,14 +52,8 @@ namespace Wabbajack.Lib.Downloaders return; } - if (!status.is_premium) - { - Utils.Error($"Automated installs with Wabbajack requires a premium nexus account. {client.Username} is not a premium account."); - return; - } - - client.ClearUpdatedModsInCache(); - //var updated = client.GetModsUpdatedSince(Game.Skyrim,DateTime.Now - TimeSpan.FromDays(30)); + if (status.is_premium) return; + Utils.Error($"Automated installs with Wabbajack requires a premium nexus account. {client.Username} is not a premium account."); } public class State : AbstractDownloadState diff --git a/Wabbajack.Test.ListValidation/ListValidation.cs b/Wabbajack.Test.ListValidation/ListValidation.cs index 47315975..e71e4317 100644 --- a/Wabbajack.Test.ListValidation/ListValidation.cs +++ b/Wabbajack.Test.ListValidation/ListValidation.cs @@ -14,22 +14,22 @@ namespace Wabbajack.Test.ListValidation [TestClass] public class ListValidation { - [TestInitialize] - public void Setup() + [ClassInitialize] + public static void SetupNexus() { - Directory.CreateDirectory(Consts.ModListDownloadFolder); - Utils.LogMessages.Subscribe(s => TestContext.WriteLine(s)); var api = new NexusApiClient(); api.ClearUpdatedModsInCache(); } - private TestContext testContextInstance; - public TestContext TestContext + [TestInitialize] + public void SetupTest() { - get { return testContextInstance; } - set { testContextInstance = value; } + Directory.CreateDirectory(Consts.ModListDownloadFolder); + Utils.LogMessages.Subscribe(s => TestContext.WriteLine(s)); } + public TestContext TestContext { get; set; } + [TestCategory("ListValidation")] [DataTestMethod] [DynamicData(nameof(GetModLists), DynamicDataSourceType.Method)]