Skip to content

Commit

Permalink
Moved enabled check for filters
Browse files Browse the repository at this point in the history
  • Loading branch information
PaciStardust committed Mar 24, 2023
1 parent 29de519 commit 7780bc0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions OscMultitool/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -792,9 +792,6 @@ private void UpdateRegex()

internal bool Matches(string compare)
{
if (!Enabled)
return false;

if (_filterRegex == null)
return compare.Contains(_filterString, _ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);

Expand Down
2 changes: 1 addition & 1 deletion OscMultitool/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static void Log(LogMessage message)
return;

foreach (var filter in Config.Debug.LogFilters)
if (filter.Matches(message.Message))
if (filter.Enabled && filter.Matches(message.Message))
return;

var messageString = message.ToString().Replace("\n", " ").Replace("\r", "");
Expand Down
2 changes: 1 addition & 1 deletion OscMultitool/Services/Api/Media.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private async static Task UpdateCurrentlyPlayingMedia(GlobalSystemMediaTransport
}

foreach (var filter in Config.Textbox.MediaFilters)
if (filter.Matches(playing))
if (filter.Enabled && filter.Matches(playing))
{
SetNotification(string.Empty);
return;
Expand Down

0 comments on commit 7780bc0

Please sign in to comment.