summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-02-25 23:27:44 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-02-25 23:27:44 -0500
commit212e85489a456acca6889faff5da835cbb707080 (patch)
treec262c217f73f9fe394763ba4403c73e51e0b07f2 /src/SMAPI.Web
parent0f8d183ec71ca42fdbfef08f7e1edc7f822ef040 (diff)
downloadSMAPI-212e85489a456acca6889faff5da835cbb707080.tar.gz
SMAPI-212e85489a456acca6889faff5da835cbb707080.tar.bz2
SMAPI-212e85489a456acca6889faff5da835cbb707080.zip
fix log parser not correctly parsing mod list if a mod has no author name
Diffstat (limited to 'src/SMAPI.Web')
-rw-r--r--src/SMAPI.Web/Framework/LogParsing/LogParser.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
index 23a1baa4..385accf0 100644
--- a/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
+++ b/src/SMAPI.Web/Framework/LogParsing/LogParser.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
+using StardewModdingAPI.Common;
using StardewModdingAPI.Web.Framework.LogParsing.Models;
namespace StardewModdingAPI.Web.Framework.LogParsing
@@ -29,7 +30,8 @@ namespace StardewModdingAPI.Web.Framework.LogParsing
private readonly Regex ModListStartPattern = new Regex(@"^Loaded \d+ mods:$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
/// <summary>A regex pattern matching an entry in SMAPI's mod list.</summary>
- private readonly Regex ModListEntryPattern = new Regex(@"^ (?<name>.+) (?<version>.+) by (?<author>.+) \| (?<description>.+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+ /// <remarks>The author name and description are optional.</remarks>
+ private readonly Regex ModListEntryPattern = new Regex(@"^ (?<name>.+?) (?<version>" + SemanticVersionImpl.UnboundedVersionPattern + @")(?: by (?<author>[^\|]+))?(?: \| (?<description>.+))?$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
/// <summary>A regex pattern matching the start of SMAPI's content pack list.</summary>
private readonly Regex ContentPackListStartPattern = new Regex(@"^Loaded \d+ content packs:$", RegexOptions.Compiled | RegexOptions.IgnoreCase);