From 063430ea162d9bd8bbc3534d851a0891b26e45b2 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 3 Feb 2025 19:18:31 -0600 Subject: [PATCH] misc: chore: Use .Match --- src/Ryujinx/DiscordIntegrationModule.cs | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Ryujinx/DiscordIntegrationModule.cs b/src/Ryujinx/DiscordIntegrationModule.cs index f1ef1448f..5d55eba42 100644 --- a/src/Ryujinx/DiscordIntegrationModule.cs +++ b/src/Ryujinx/DiscordIntegrationModule.cs @@ -135,21 +135,21 @@ namespace Ryujinx.Ava if (!TitleIDs.CurrentApplication.Value.HasValue) return; if (_discordPresencePlaying is null) return; - PlayReportAnalyzer.FormattedValue value = PlayReport.Analyzer.FormatPlayReportValue(TitleIDs.CurrentApplication.Value, _currentApp, playReport); - - if (!value.Handled) return; - - if (value.Reset) - { - _discordPresencePlaying.Details = $"Playing {_currentApp.Title}"; - Logger.Info?.Print(LogClass.UI, "Reset Discord RPC based on a supported play report value formatter."); - } - else - { - _discordPresencePlaying.Details = value.FormattedString; - Logger.Info?.Print(LogClass.UI, "Updated Discord RPC based on a supported play report."); - } - UpdatePlayingState(); + PlayReport.Analyzer.FormatPlayReportValue(TitleIDs.CurrentApplication.Value, _currentApp, playReport) + .Match(out bool handled, + () => + { + _discordPresencePlaying.Details = $"Playing {_currentApp.Title}"; + Logger.Info?.Print(LogClass.UI, "Reset Discord RPC based on a supported play report value formatter."); + }, + formattedString => + { + _discordPresencePlaying.Details = formattedString; + Logger.Info?.Print(LogClass.UI, "Updated Discord RPC based on a supported play report."); + }); + + if (handled) + UpdatePlayingState(); } private static string TruncateToByteLength(string input)