misc: chore: Use ApplicationLibrary helpers for getting DLCs & Updates for a game
This commit is contained in:
parent
b0fcc5bee1
commit
222ceb818b
@ -69,8 +69,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
private void LoadDownloadableContents()
|
private void LoadDownloadableContents()
|
||||||
{
|
{
|
||||||
IEnumerable<(DownloadableContentModel Dlc, bool IsEnabled)> dlcs = _applicationLibrary.DownloadableContents.Items
|
(DownloadableContentModel Dlc, bool IsEnabled)[] dlcs = _applicationLibrary.FindDlcConfigurationFor(_applicationData.Id);
|
||||||
.Where(it => it.Dlc.TitleIdBase == _applicationData.IdBase);
|
|
||||||
|
|
||||||
bool hasBundledContent = false;
|
bool hasBundledContent = false;
|
||||||
foreach ((DownloadableContentModel dlc, bool isEnabled) in dlcs)
|
foreach ((DownloadableContentModel dlc, bool isEnabled) in dlcs)
|
||||||
|
@ -41,8 +41,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
private void LoadUpdates()
|
private void LoadUpdates()
|
||||||
{
|
{
|
||||||
IEnumerable<(TitleUpdateModel TitleUpdate, bool IsSelected)> updates = ApplicationLibrary.TitleUpdates.Items
|
(TitleUpdateModel TitleUpdate, bool IsSelected)[] updates = ApplicationLibrary.FindUpdateConfigurationFor(ApplicationData.Id);
|
||||||
.Where(it => it.TitleUpdate.TitleIdBase == ApplicationData.IdBase);
|
|
||||||
|
|
||||||
bool hasBundledContent = false;
|
bool hasBundledContent = false;
|
||||||
SelectedUpdate = new TitleUpdateViewModelNoUpdate();
|
SelectedUpdate = new TitleUpdateViewModelNoUpdate();
|
||||||
|
@ -160,9 +160,15 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
|
|||||||
public TitleUpdateModel[] FindUpdatesFor(ulong id)
|
public TitleUpdateModel[] FindUpdatesFor(ulong id)
|
||||||
=> TitleUpdates.Keys.Where(x => x.TitleIdBase == (id & ~0x1FFFUL)).ToArray();
|
=> TitleUpdates.Keys.Where(x => x.TitleIdBase == (id & ~0x1FFFUL)).ToArray();
|
||||||
|
|
||||||
|
public (TitleUpdateModel TitleUpdate, bool IsSelected)[] FindUpdateConfigurationFor(ulong id)
|
||||||
|
=> TitleUpdates.Items.Where(x => x.TitleUpdate.TitleIdBase == (id & ~0x1FFFUL)).ToArray();
|
||||||
|
|
||||||
public DownloadableContentModel[] FindDlcsFor(ulong id)
|
public DownloadableContentModel[] FindDlcsFor(ulong id)
|
||||||
=> DownloadableContents.Keys.Where(x => x.TitleIdBase == (id & ~0x1FFFUL)).ToArray();
|
=> DownloadableContents.Keys.Where(x => x.TitleIdBase == (id & ~0x1FFFUL)).ToArray();
|
||||||
|
|
||||||
|
public (DownloadableContentModel Dlc, bool IsEnabled)[] FindDlcConfigurationFor(ulong id)
|
||||||
|
=> DownloadableContents.Items.Where(x => x.Dlc.TitleIdBase == (id & ~0x1FFFUL)).ToArray();
|
||||||
|
|
||||||
public bool HasDlcs(ulong id)
|
public bool HasDlcs(ulong id)
|
||||||
=> DownloadableContents.Keys.Any(x => x.TitleIdBase == (id & ~0x1FFFUL));
|
=> DownloadableContents.Keys.Any(x => x.TitleIdBase == (id & ~0x1FFFUL));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user