Skip to content

Commit

Permalink
UI: RPC: Only show hours at maximum for play time
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev authored and marco-carvalho committed Jan 5, 2025
1 parent c33e055 commit adf9ea1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Ryujinx.UI.Common/DiscordIntegrationModule.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using DiscordRPC;
using Humanizer;
using LibHac.Bcat;
using Humanizer.Localisation;
using Ryujinx.Common;
using Ryujinx.HLE.Loaders.Processes;
using Ryujinx.UI.App.Common;
using Ryujinx.UI.Common.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Text;

Expand Down Expand Up @@ -78,13 +77,13 @@ public static void SwitchToPlayingState(ApplicationMetadata appMeta, ProcessResu
Assets = new Assets
{
LargeImageKey = _discordGameAssetKeys.Contains(procRes.ProgramIdText) ? procRes.ProgramIdText : "game",
LargeImageText = TruncateToByteLength($"{appMeta.Title} | {procRes.DisplayVersion}"),
LargeImageText = TruncateToByteLength($"{appMeta.Title} (v{procRes.DisplayVersion})"),
SmallImageKey = "ryujinx",
SmallImageText = TruncateToByteLength(_description)
},
Details = TruncateToByteLength($"Playing {appMeta.Title}"),
State = appMeta.LastPlayed.HasValue && appMeta.TimePlayed.TotalSeconds > 5
? $"Total play time: {appMeta.TimePlayed.Humanize(2, false)}"
? $"Total play time: {appMeta.TimePlayed.Humanize(2, false, maxUnit: TimeUnit.Hour)}"
: "Never played",
Timestamps = Timestamps.Now
});
Expand Down

0 comments on commit adf9ea1

Please sign in to comment.