WiiUtils: Skip WAD import if it's already installed
The check is fairly quick, and this allows saving a lot of time and resources for larger WADs.
This commit is contained in:
parent
5fdb19f3db
commit
0bdeb63894
|
@ -113,6 +113,15 @@ bool InstallWAD(const std::string& wad_path)
|
||||||
{
|
{
|
||||||
IOS::HLE::Kernel ios;
|
IOS::HLE::Kernel ios;
|
||||||
const DiscIO::WiiWAD wad{wad_path};
|
const DiscIO::WiiWAD wad{wad_path};
|
||||||
|
|
||||||
|
if (!wad.GetTMD().IsValid())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Skip the install if the WAD is already installed.
|
||||||
|
const auto installed_contents = ios.GetES()->GetStoredContentsFromTMD(wad.GetTMD());
|
||||||
|
if (wad.GetTMD().GetContents() == installed_contents)
|
||||||
|
return true;
|
||||||
|
|
||||||
const bool result = InstallWAD(ios, wad);
|
const bool result = InstallWAD(ios, wad);
|
||||||
|
|
||||||
DiscIO::NANDContentManager::Access().ClearCache();
|
DiscIO::NANDContentManager::Access().ClearCache();
|
||||||
|
|
Loading…
Reference in New Issue