mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-11 04:35:05 +01:00
qt: do not use an invalid update smdh
This commit is contained in:
parent
020cd56ad8
commit
cadfd6834d
@ -60,28 +60,24 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
|
|||||||
u64 extdata_id = 0;
|
u64 extdata_id = 0;
|
||||||
loader->ReadExtdataId(extdata_id);
|
loader->ReadExtdataId(extdata_id);
|
||||||
|
|
||||||
std::vector<u8> smdh = [program_id, &loader]() -> std::vector<u8> {
|
std::vector<u8> smdh;
|
||||||
std::vector<u8> original_smdh;
|
// Look for an update icon if available
|
||||||
loader->ReadIcon(original_smdh);
|
if (!(program_id & ~0x00040000FFFFFFFF)) {
|
||||||
|
|
||||||
if (program_id < 0x0004000000000000 || program_id > 0x00040000FFFFFFFF)
|
|
||||||
return original_smdh;
|
|
||||||
|
|
||||||
std::string update_path = Service::AM::GetTitleContentPath(
|
std::string update_path = Service::AM::GetTitleContentPath(
|
||||||
Service::FS::MediaType::SDMC, program_id + 0x0000000E00000000);
|
Service::FS::MediaType::SDMC, program_id | 0x0000000E00000000);
|
||||||
|
if (FileUtil::Exists(update_path)) {
|
||||||
|
std::unique_ptr<Loader::AppLoader> update_loader =
|
||||||
|
Loader::GetLoader(update_path);
|
||||||
|
if (update_loader) {
|
||||||
|
update_loader->ReadIcon(smdh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!FileUtil::Exists(update_path))
|
if (!Loader::IsValidSMDH(smdh)) {
|
||||||
return original_smdh;
|
// Read the original smdh if there is no valid update smdh
|
||||||
|
loader->ReadIcon(smdh);
|
||||||
std::unique_ptr<Loader::AppLoader> update_loader = Loader::GetLoader(update_path);
|
}
|
||||||
|
|
||||||
if (!update_loader)
|
|
||||||
return original_smdh;
|
|
||||||
|
|
||||||
std::vector<u8> update_smdh;
|
|
||||||
update_loader->ReadIcon(update_smdh);
|
|
||||||
return update_smdh;
|
|
||||||
}();
|
|
||||||
|
|
||||||
if (!Loader::IsValidSMDH(smdh) && UISettings::values.game_list_hide_no_icon) {
|
if (!Loader::IsValidSMDH(smdh) && UISettings::values.game_list_hide_no_icon) {
|
||||||
// Skip this invalid entry
|
// Skip this invalid entry
|
||||||
|
Loading…
Reference in New Issue
Block a user