From e0ef8a20a5e7ccf1de32ff1a06f1aa62e37eb1db Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 19 Jun 2022 17:21:53 -0400 Subject: fix mod count in log parser metadata --- .../Framework/LogParsing/Models/LogModInfo.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs') diff --git a/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs b/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs index a6b9165c..4b80a830 100644 --- a/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs +++ b/src/SMAPI.Web/Framework/LogParsing/Models/LogModInfo.cs @@ -39,9 +39,15 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models [MemberNotNullWhen(true, nameof(LogModInfo.UpdateVersion), nameof(LogModInfo.UpdateLink))] public bool HasUpdate => this.UpdateVersion != null && this.Version != this.UpdateVersion; - /// Whether the mod is a content pack for another mod. + /// Whether this is an actual mod (rather than a special entry for SMAPI or the game itself). + public bool IsMod { get; } + + /// Whether this is a C# code mod. + public bool IsCodeMod { get; } + + /// Whether this is a content pack for another mod. [MemberNotNullWhen(true, nameof(LogModInfo.ContentPackFor))] - public bool IsContentPack => !string.IsNullOrWhiteSpace(this.ContentPackFor); + public bool IsContentPack { get; } /********* @@ -57,7 +63,8 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models /// The name of the mod for which this is a content pack (if applicable). /// The number of errors logged by this mod. /// Whether the mod was loaded into the game. - public LogModInfo(string name, string author, string version, string description, string? updateVersion = null, string? updateLink = null, string? contentPackFor = null, int errors = 0, bool loaded = true) + /// Whether this is an actual mod (instead of a special entry for SMAPI or the game). + public LogModInfo(string name, string author, string version, string description, string? updateVersion = null, string? updateLink = null, string? contentPackFor = null, int errors = 0, bool loaded = true, bool isMod = true) { this.Name = name; this.Author = author; @@ -68,6 +75,13 @@ namespace StardewModdingAPI.Web.Framework.LogParsing.Models this.ContentPackFor = contentPackFor; this.Errors = errors; this.Loaded = loaded; + + if (isMod) + { + this.IsMod = true; + this.IsContentPack = !string.IsNullOrWhiteSpace(this.ContentPackFor); + this.IsCodeMod = !this.IsContentPack; + } } /// Add an update alert for this mod. -- cgit