diff --git a/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs index 5486bd67d..f920023cd 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs @@ -1363,7 +1363,7 @@ namespace Ryujinx.Ava.UI.ViewModels if (prevUserId != AccountManager.LastOpenedUser.UserId) { // current user changed, so refresh application metadata - LoadApplications(); + RefreshApplicationsMetadata(); } } @@ -1372,6 +1372,22 @@ namespace Ryujinx.Ava.UI.ViewModels AppHost.Device.System.SimulateWakeUpMessage(); } + private async void RefreshApplicationsMetadata() + { + await Task.Run(() => { + foreach (var app in _applications) + { + var metadata = ApplicationLibrary.LoadAndSaveMetaData(AccountManager.LastOpenedUser.UserId.ToLibHacFsUid(), app.TitleId); + app.Favorite = metadata.Favorite; + app.LastPlayed = metadata.LastPlayed; + app.TimePlayedNum = metadata.TimePlayed; + app.TimePlayed = ApplicationLibrary.ConvertSecondsToFormattedString(metadata.TimePlayed); + } + }); + + RefreshView(); + } + public async void LoadApplications() { await Dispatcher.UIThread.InvokeAsync(() => diff --git a/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs b/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs index 2f473eac5..4875cafbf 100644 --- a/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs @@ -733,7 +733,7 @@ namespace Ryujinx.Ui.App.Common return applicationIcon ?? _ncaIcon; } - private static string ConvertSecondsToFormattedString(double seconds) + public static string ConvertSecondsToFormattedString(double seconds) { System.TimeSpan time = System.TimeSpan.FromSeconds(seconds);