mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-26 18:43:04 +00:00
Better cache lookup for apps
This commit is contained in:
parent
4bf437180f
commit
2b0e121b17
1 changed files with 3 additions and 3 deletions
|
@ -44,7 +44,7 @@ namespace Ryujinx.UI.App.Common
|
||||||
public event EventHandler<ApplicationAddedEventArgs> ApplicationAdded;
|
public event EventHandler<ApplicationAddedEventArgs> ApplicationAdded;
|
||||||
public event EventHandler<ApplicationCountUpdatedEventArgs> ApplicationCountUpdated;
|
public event EventHandler<ApplicationCountUpdatedEventArgs> ApplicationCountUpdated;
|
||||||
|
|
||||||
public readonly IObservableCache<ApplicationData, (ulong Id, string Path)> Applications;
|
public readonly IObservableCache<ApplicationData, ulong> Applications;
|
||||||
public readonly IObservableCache<(TitleUpdateModel TitleUpdate, bool IsSelected), TitleUpdateModel> TitleUpdates;
|
public readonly IObservableCache<(TitleUpdateModel TitleUpdate, bool IsSelected), TitleUpdateModel> TitleUpdates;
|
||||||
public readonly IObservableCache<(DownloadableContentModel Dlc, bool IsEnabled), DownloadableContentModel> DownloadableContents;
|
public readonly IObservableCache<(DownloadableContentModel Dlc, bool IsEnabled), DownloadableContentModel> DownloadableContents;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ namespace Ryujinx.UI.App.Common
|
||||||
private readonly VirtualFileSystem _virtualFileSystem;
|
private readonly VirtualFileSystem _virtualFileSystem;
|
||||||
private readonly IntegrityCheckLevel _checkLevel;
|
private readonly IntegrityCheckLevel _checkLevel;
|
||||||
private CancellationTokenSource _cancellationToken;
|
private CancellationTokenSource _cancellationToken;
|
||||||
private readonly SourceCache<ApplicationData, (ulong Id, string Path)> _applications = new(it => (it.Id, it.Path));
|
private readonly SourceCache<ApplicationData, ulong> _applications = new(it => it.Id);
|
||||||
private readonly SourceCache<(TitleUpdateModel TitleUpdate, bool IsSelected), TitleUpdateModel> _titleUpdates = new(it => it.TitleUpdate);
|
private readonly SourceCache<(TitleUpdateModel TitleUpdate, bool IsSelected), TitleUpdateModel> _titleUpdates = new(it => it.TitleUpdate);
|
||||||
private readonly SourceCache<(DownloadableContentModel Dlc, bool IsEnabled), DownloadableContentModel> _downloadableContents = new(it => it.Dlc);
|
private readonly SourceCache<(DownloadableContentModel Dlc, bool IsEnabled), DownloadableContentModel> _downloadableContents = new(it => it.Dlc);
|
||||||
|
|
||||||
|
@ -887,7 +887,7 @@ namespace Ryujinx.UI.App.Common
|
||||||
{
|
{
|
||||||
foreach (var dlc in foundDlcs.Where(it => appIdLookup.Contains(it.TitleIdBase)))
|
foreach (var dlc in foundDlcs.Where(it => appIdLookup.Contains(it.TitleIdBase)))
|
||||||
{
|
{
|
||||||
if (!DownloadableContents.Items.Any(it => it.Dlc == dlc))
|
if (!_downloadableContents.Lookup( dlc).HasValue)
|
||||||
{
|
{
|
||||||
_downloadableContents.AddOrUpdate((dlc, true));
|
_downloadableContents.AddOrUpdate((dlc, true));
|
||||||
SaveDownloadableContentsForGame(dlc.TitleIdBase);
|
SaveDownloadableContentsForGame(dlc.TitleIdBase);
|
||||||
|
|
Loading…
Reference in a new issue