mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-15 07:00:32 +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)
|
if (prevUserId != AccountManager.LastOpenedUser.UserId)
|
||||||
{
|
{
|
||||||
// current user changed, so refresh application metadata
|
// current user changed, so refresh application metadata
|
||||||
LoadApplications();
|
RefreshApplicationsMetadata();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1372,6 +1372,22 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
AppHost.Device.System.SimulateWakeUpMessage();
|
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()
|
public async void LoadApplications()
|
||||||
{
|
{
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
|
|
|
@ -733,7 +733,7 @@ namespace Ryujinx.Ui.App.Common
|
||||||
return applicationIcon ?? _ncaIcon;
|
return applicationIcon ?? _ncaIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ConvertSecondsToFormattedString(double seconds)
|
public static string ConvertSecondsToFormattedString(double seconds)
|
||||||
{
|
{
|
||||||
System.TimeSpan time = System.TimeSpan.FromSeconds(seconds);
|
System.TimeSpan time = System.TimeSpan.FromSeconds(seconds);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue