From e7b214390a09fc6edc7664bce0b48cecf1d986a8 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 31 Aug 2019 16:27:36 -0400 Subject: move platform to log parser model instead of middleware --- src/SMAPI.Web/ViewModels/LogParserModel.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/SMAPI.Web/ViewModels') diff --git a/src/SMAPI.Web/ViewModels/LogParserModel.cs b/src/SMAPI.Web/ViewModels/LogParserModel.cs index 25493a29..f4c5214b 100644 --- a/src/SMAPI.Web/ViewModels/LogParserModel.cs +++ b/src/SMAPI.Web/ViewModels/LogParserModel.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; +using StardewModdingAPI.Toolkit.Utilities; using StardewModdingAPI.Web.Framework.LogParsing.Models; namespace StardewModdingAPI.Web.ViewModels @@ -24,6 +25,9 @@ namespace StardewModdingAPI.Web.ViewModels /// The paste ID. public string PasteID { get; set; } + /// The viewer's detected OS, if known. + public Platform? DetectedPlatform { get; set; } + /// The parsed log info. public ParsedLog ParsedLog { get; set; } @@ -46,24 +50,25 @@ namespace StardewModdingAPI.Web.ViewModels /// Construct an instance. /// The root URL for the log parser controller. /// The paste ID. - public LogParserModel(string sectionUrl, string pasteID) + /// The viewer's detected OS, if known. + public LogParserModel(string sectionUrl, string pasteID, Platform? platform) { this.SectionUrl = sectionUrl; this.PasteID = pasteID; + this.DetectedPlatform = platform; this.ParsedLog = null; this.ShowRaw = false; } - /// Construct an instance. - /// The root URL for the log parser controller. - /// The paste ID. + /// Set the log parser result. /// The parsed log info. /// Whether to show the raw unparsed log. - public LogParserModel(string sectionUrl, string pasteID, ParsedLog parsedLog, bool showRaw) - : this(sectionUrl, pasteID) + public LogParserModel SetResult(ParsedLog parsedLog, bool showRaw) { this.ParsedLog = parsedLog; this.ShowRaw = showRaw; + + return this; } /// Get all content packs in the log grouped by the mod they're for. -- cgit