Skip to content

Commit

Permalink
Added check for eventual symlink when displaying game files. (Ryujinx…
Browse files Browse the repository at this point in the history
…#4526)

* Added check for eventual symlink when displaying game files.

* Moved symlink check logic

* Moved symlink check logic

* Fixed prev commit

---------

Co-authored-by: Daniel Shala <danielshala00@gmail.com>
  • Loading branch information
Shalito01 and daniel774 committed Apr 15, 2023
1 parent 11ecff2 commit 5c89e22
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Ryujinx.Ui.Common/App/ApplicationLibrary.cs
Expand Up @@ -116,11 +116,13 @@ public void LoadApplications(List<string> appDirs, Language desiredTitleLanguage
return;
}

string extension = Path.GetExtension(app).ToLower();
var fileInfo = new FileInfo(app);
string extension = fileInfo.Extension.ToLower();

if (!File.GetAttributes(app).HasFlag(FileAttributes.Hidden) && extension is ".nsp" or ".pfs0" or ".xci" or ".nca" or ".nro" or ".nso")
if (!fileInfo.Attributes.HasFlag(FileAttributes.Hidden) && extension is ".nsp" or ".pfs0" or ".xci" or ".nca" or ".nro" or ".nso")
{
applications.Add(app);
var fullPath = fileInfo.ResolveLinkTarget(true)?.FullName ?? fileInfo.FullName;
applications.Add(fullPath);
numApplicationsFound++;
}
}
Expand Down Expand Up @@ -904,4 +906,5 @@ public static (Nca patch, Nca control) GetGameUpdateData(VirtualFileSystem fileS
return (null, null);
}
}
}
}

0 comments on commit 5c89e22

Please sign in to comment.