Skip to content

Commit

Permalink
Add all DLCs from a PFS
Browse files Browse the repository at this point in the history
  • Loading branch information
TSRBerry committed Mar 23, 2024
1 parent 9d90cd4 commit 5c315fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Ryujinx.Gtk3/UI/Windows/DlcWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void AddDlc(string path, bool ignoreNotFound = false)
{
if (nca.GetProgramIdBase() != (ulong.Parse(_applicationId, NumberStyles.HexNumber) & ~0x1FFFUL))
{
break;
continue;
}

parentIter ??= ((TreeStore)_dlcTreeView.Model).AppendValues(true, "", path);
Expand Down
16 changes: 10 additions & 6 deletions src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ private bool AddDownloadableContent(string path)

using IFileSystem partitionFileSystem = PartitionFileSystemUtils.OpenApplicationFileSystem(path, _virtualFileSystem);

bool success = false;
foreach (DirectoryEntryEx fileEntry in partitionFileSystem.EnumerateEntries("/", "*.nca"))
{
using var ncaFile = new UniqueRef<IFile>();
Expand All @@ -257,21 +258,24 @@ private bool AddDownloadableContent(string path)
{
if (nca.GetProgramIdBase() != _applicationData.IdBase)
{
break;
continue;
}

var content = new DownloadableContentModel(nca.Header.TitleId.ToString("X16"), path, fileEntry.FullPath, true);
DownloadableContents.Add(content);
SelectedDownloadableContents.Add(content);

OnPropertyChanged(nameof(UpdateCount));
Sort();

return true;
success = true;
}
}

return false;
if (success)
{
OnPropertyChanged(nameof(UpdateCount));
Sort();
}

return success;
}

public void Remove(DownloadableContentModel model)
Expand Down

0 comments on commit 5c315fd

Please sign in to comment.