Skip to content

Commit

Permalink
Minor HighlightType parsing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Nov 28, 2023
1 parent c867f4a commit 330170d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TwitchDownloaderCore/Tools/HighlightIcons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static HighlightType GetHighlightType(Comment comment)
if (bodyWithoutName.StartsWith(" is paying forward the Gift they got from"))
return HighlightType.PayingForward;

if (bodyWithoutName.Contains(" consecutive streams this month and sparked a watch streak!", StringComparison.Ordinal))
if (bodyWithoutName.EndsWith(" consecutive streams this month and sparked a watch streak! "))
return HighlightType.WatchStreak;

if (bodyWithoutName.StartsWith(" converted from a"))
Expand All @@ -116,7 +116,7 @@ public static HighlightType GetHighlightType(Comment comment)
if (bodySpan.Equals("bits badge tier notification ", StringComparison.Ordinal))
return HighlightType.BitBadgeTierNotification;

if (char.IsDigit(bodySpan[0]) && bodySpan.Contains("have joined!", StringComparison.Ordinal))
if (char.IsDigit(bodySpan[0]) && bodySpan.EndsWith(" have joined! "))
{
// TODO: use bodySpan when .NET 7
if (Regex.IsMatch(comment.message.body, $@"^\d+ raiders from {comment.commenter.display_name} have joined!"))
Expand Down

0 comments on commit 330170d

Please sign in to comment.