diff --git a/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs index 81f1e7312..71dc12be3 100644 --- a/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx.Ava/UI/ViewModels/MainWindowViewModel.cs @@ -1357,12 +1357,12 @@ namespace Ryujinx.Ava.UI.ViewModels public async void ManageProfiles() { - var prevUserId = AccountManager.LastOpenedUser.UserId; + var oldLastOpenedUserId = AccountManager.LastOpenedUser.UserId; await NavigationDialogHost.Show(AccountManager, ContentManager, VirtualFileSystem, LibHacHorizonManager.RyujinxClient); - if (prevUserId != AccountManager.LastOpenedUser.UserId) + if (oldLastOpenedUserId != AccountManager.LastOpenedUser.UserId) { - // current user changed, so refresh application metadata + // Opened user changed, so refresh application metadata. _ = Task.Run(RefreshApplicationsMetadata); } } @@ -1377,6 +1377,7 @@ namespace Ryujinx.Ava.UI.ViewModels 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; diff --git a/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs b/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs index 3cfa6b972..1a47c39df 100644 --- a/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs @@ -516,14 +516,14 @@ namespace Ryujinx.Ui.App.Common Directory.CreateDirectory(metadataFolder); - // Handle migration from old default to current user + // NOTE: Handle migration from old default to current user. Should be removed later. string legacyFile = Path.Combine(guiFolder, "metadata.json"); if (File.Exists(legacyFile) && !File.Exists(metadataFile)) { File.Move(legacyFile, metadataFile); } - // Create metadata file if it doesn't exist yet + // Create metadata file if it doesn't exist yet. ApplicationMetadata appMetadata; if (!File.Exists(metadataFile)) @@ -533,7 +533,7 @@ namespace Ryujinx.Ui.App.Common JsonHelper.SerializeToFile(metadataFile, appMetadata, SerializerContext.ApplicationMetadata); } - // Read from the metadata file + // Read from the metadata file. try { appMetadata = JsonHelper.DeserializeFromFile(metadataFile, SerializerContext.ApplicationMetadata); @@ -545,7 +545,7 @@ namespace Ryujinx.Ui.App.Common appMetadata = new ApplicationMetadata(); } - // Modify the metadata and save it back to the file + // Modify the metadata and save it back to the file. if (modifyFunction != null) { modifyFunction(appMetadata);