From b2a6933efb0719b48034eff8c29b5f12beb00248 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 28 Jan 2021 21:21:18 -0500 Subject: fix mod type defaulted incorrectly in SMAPI toolkit --- src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/SMAPI.Toolkit') diff --git a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs index 86a97016..fd206d9d 100644 --- a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -177,12 +177,17 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning } // get mod type - ModType type = ModType.Invalid; - if (manifest != null) + ModType type; { - type = !string.IsNullOrWhiteSpace(manifest.ContentPackFor?.UniqueID) - ? ModType.ContentPack - : ModType.Smapi; + bool isContentPack = !string.IsNullOrWhiteSpace(manifest?.ContentPackFor?.UniqueID); + bool isSmapi = !string.IsNullOrWhiteSpace(manifest?.EntryDll); + + if (isContentPack == isSmapi) + type = ModType.Invalid; + else if (isContentPack) + type = ModType.ContentPack; + else + type = ModType.Smapi; } // build result -- cgit From 50d7e95920e1963af583f398055c6e8ad5df1033 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 19 Feb 2021 22:54:01 -0500 Subject: fix errors parsing the mod compatibility list on the new wiki --- docs/release-notes.md | 1 + src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/SMAPI.Toolkit') diff --git a/docs/release-notes.md b/docs/release-notes.md index 82913873..041071e0 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -22,6 +22,7 @@ * Added error details when an event command fails. * For the web UI: + * Updated for the new wiki. * Updated the JSON validator/schema for Content Patcher 1.20. * Fixed mod compatibility list error if a mod has no name. diff --git a/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs b/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs index 89a22eaf..da312471 100644 --- a/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs +++ b/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiClient.cs @@ -50,13 +50,13 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki doc.LoadHtml(html); // fetch game versions - string stableVersion = doc.DocumentNode.SelectSingleNode("div[@class='game-stable-version']")?.InnerText; - string betaVersion = doc.DocumentNode.SelectSingleNode("div[@class='game-beta-version']")?.InnerText; + string stableVersion = doc.DocumentNode.SelectSingleNode("//div[@class='game-stable-version']")?.InnerText; + string betaVersion = doc.DocumentNode.SelectSingleNode("//div[@class='game-beta-version']")?.InnerText; if (betaVersion == stableVersion) betaVersion = null; // find mod entries - HtmlNodeCollection modNodes = doc.DocumentNode.SelectNodes("table[@id='mod-list']//tr[@class='mod']"); + HtmlNodeCollection modNodes = doc.DocumentNode.SelectNodes("//table[@id='mod-list']//tr[@class='mod']"); if (modNodes == null) throw new InvalidOperationException("Can't parse wiki compatibility list, no mods found."); -- cgit