misc: chore: Use .Match

This commit is contained in:
Evan Husted 2025-02-03 19:18:31 -06:00
parent 65f08caaa3
commit 063430ea16

View File

@ -135,20 +135,20 @@ namespace Ryujinx.Ava
if (!TitleIDs.CurrentApplication.Value.HasValue) return; if (!TitleIDs.CurrentApplication.Value.HasValue) return;
if (_discordPresencePlaying is null) return; if (_discordPresencePlaying is null) return;
PlayReportAnalyzer.FormattedValue value = PlayReport.Analyzer.FormatPlayReportValue(TitleIDs.CurrentApplication.Value, _currentApp, playReport); PlayReport.Analyzer.FormatPlayReportValue(TitleIDs.CurrentApplication.Value, _currentApp, playReport)
.Match(out bool handled,
if (!value.Handled) return; () =>
if (value.Reset)
{ {
_discordPresencePlaying.Details = $"Playing {_currentApp.Title}"; _discordPresencePlaying.Details = $"Playing {_currentApp.Title}";
Logger.Info?.Print(LogClass.UI, "Reset Discord RPC based on a supported play report value formatter."); Logger.Info?.Print(LogClass.UI, "Reset Discord RPC based on a supported play report value formatter.");
} },
else formattedString =>
{ {
_discordPresencePlaying.Details = value.FormattedString; _discordPresencePlaying.Details = formattedString;
Logger.Info?.Print(LogClass.UI, "Updated Discord RPC based on a supported play report."); Logger.Info?.Print(LogClass.UI, "Updated Discord RPC based on a supported play report.");
} });
if (handled)
UpdatePlayingState(); UpdatePlayingState();
} }