diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-08-31 16:27:36 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-09-14 19:14:56 -0400 |
commit | e7b214390a09fc6edc7664bce0b48cecf1d986a8 (patch) | |
tree | 05e20f4ad3012c95e29daded4c04cc72b4e91c45 /src/SMAPI.Web/ViewModels/LogParserModel.cs | |
parent | d49ead6113c85d3b30db664aad1a965ffdef6bbb (diff) | |
download | SMAPI-e7b214390a09fc6edc7664bce0b48cecf1d986a8.tar.gz SMAPI-e7b214390a09fc6edc7664bce0b48cecf1d986a8.tar.bz2 SMAPI-e7b214390a09fc6edc7664bce0b48cecf1d986a8.zip |
move platform to log parser model instead of middleware
Diffstat (limited to 'src/SMAPI.Web/ViewModels/LogParserModel.cs')
-rw-r--r-- | src/SMAPI.Web/ViewModels/LogParserModel.cs | 17 |
1 files changed, 11 insertions, 6 deletions
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 /// <summary>The paste ID.</summary> public string PasteID { get; set; } + /// <summary>The viewer's detected OS, if known.</summary> + public Platform? DetectedPlatform { get; set; } + /// <summary>The parsed log info.</summary> public ParsedLog ParsedLog { get; set; } @@ -46,24 +50,25 @@ namespace StardewModdingAPI.Web.ViewModels /// <summary>Construct an instance.</summary> /// <param name="sectionUrl">The root URL for the log parser controller.</param> /// <param name="pasteID">The paste ID.</param> - public LogParserModel(string sectionUrl, string pasteID) + /// <param name="platform">The viewer's detected OS, if known.</param> + public LogParserModel(string sectionUrl, string pasteID, Platform? platform) { this.SectionUrl = sectionUrl; this.PasteID = pasteID; + this.DetectedPlatform = platform; this.ParsedLog = null; this.ShowRaw = false; } - /// <summary>Construct an instance.</summary> - /// <param name="sectionUrl">The root URL for the log parser controller.</param> - /// <param name="pasteID">The paste ID.</param> + /// <summary>Set the log parser result.</summary> /// <param name="parsedLog">The parsed log info.</param> /// <param name="showRaw">Whether to show the raw unparsed log.</param> - 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; } /// <summary>Get all content packs in the log grouped by the mod they're for.</summary> |