mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-14 22:50:34 +00:00
Only refresh metadata, not whole applications list
This commit is contained in:
parent
ac716fb3b8
commit
8051e3710b
2 changed files with 18 additions and 2 deletions
|
@ -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(() =>
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue