mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Don't add unnecessary ".cnmt" to SwitchFs nca names
This commit is contained in:
parent
9d813ade18
commit
614adb2a31
1 changed files with 11 additions and 1 deletions
|
@ -80,7 +80,7 @@ namespace LibHac
|
|||
|
||||
nca = new SwitchFsNca(new Nca(Keyset, storage));
|
||||
|
||||
nca.NcaId = Path.GetFileNameWithoutExtension(fileEntry.Name);
|
||||
nca.NcaId = GetNcaFilename(fileEntry.Name, nca);
|
||||
string extension = nca.Nca.Header.ContentType == ContentType.Meta ? ".cnmt.nca" : ".nca";
|
||||
nca.Filename = nca.NcaId + extension;
|
||||
}
|
||||
|
@ -227,6 +227,16 @@ namespace LibHac
|
|||
}
|
||||
}
|
||||
|
||||
private string GetNcaFilename(string name, SwitchFsNca nca)
|
||||
{
|
||||
if (nca.Nca.Header.ContentType != ContentType.Meta || !name.EndsWith(".cnmt.nca"))
|
||||
{
|
||||
return Path.GetFileNameWithoutExtension(name);
|
||||
}
|
||||
|
||||
return name.Substring(0, name.Length - ".cnmt.nca".Length);
|
||||
}
|
||||
|
||||
private void DisposeNcas()
|
||||
{
|
||||
//foreach (SwitchFsNca nca in Ncas.Values)
|
||||
|
|
Loading…
Reference in a new issue