From 7780bc0a039b4f7bf1e291a5660e4d0b927f2c61 Mon Sep 17 00:00:00 2001 From: Paci <89483951+PaciStardust@users.noreply.github.com> Date: Fri, 24 Mar 2023 19:45:47 +0100 Subject: [PATCH] Moved enabled check for filters --- OscMultitool/Config.cs | 3 --- OscMultitool/Logger.cs | 2 +- OscMultitool/Services/Api/Media.cs | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/OscMultitool/Config.cs b/OscMultitool/Config.cs index e06d25f..36c94fe 100644 --- a/OscMultitool/Config.cs +++ b/OscMultitool/Config.cs @@ -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); diff --git a/OscMultitool/Logger.cs b/OscMultitool/Logger.cs index 2ffbcd9..05b4422 100644 --- a/OscMultitool/Logger.cs +++ b/OscMultitool/Logger.cs @@ -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", ""); diff --git a/OscMultitool/Services/Api/Media.cs b/OscMultitool/Services/Api/Media.cs index 1eee531..636e227 100644 --- a/OscMultitool/Services/Api/Media.cs +++ b/OscMultitool/Services/Api/Media.cs @@ -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;