only pass one smdh
This commit is contained in:
parent
4da837c929
commit
eb1b5f588a
2 changed files with 16 additions and 21 deletions
|
@ -396,37 +396,34 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
|
|||
if (!loader)
|
||||
return true;
|
||||
|
||||
std::vector<u8> smdh;
|
||||
loader->ReadIcon(smdh);
|
||||
|
||||
u64 program_id = 0;
|
||||
loader->ReadProgramId(program_id);
|
||||
|
||||
std::vector<u8> update_smdh = [program_id]() -> std::vector<u8> {
|
||||
if (0x4000000000000 > program_id && program_id > 0x40000FFFFFFFF)
|
||||
return {};
|
||||
std::vector<u8> smdh = [program_id, &loader]() -> std::vector<u8> {
|
||||
std::vector<u8> original_smdh;
|
||||
loader->ReadIcon(original_smdh);
|
||||
|
||||
u64 update_id = program_id + 0xe00000000;
|
||||
std::string update_path =
|
||||
Service::AM::GetTitleContentPath(Service::FS::MediaType::SDMC, update_id);
|
||||
if (0x4000000000000 > program_id && program_id > 0x40000FFFFFFFF)
|
||||
return original_smdh;
|
||||
|
||||
std::string update_path = Service::AM::GetTitleContentPath(
|
||||
Service::FS::MediaType::SDMC, program_id + 0xe00000000);
|
||||
|
||||
if (!FileUtil::Exists(update_path))
|
||||
return {};
|
||||
return original_smdh;
|
||||
|
||||
std::unique_ptr<Loader::AppLoader> update_loader = Loader::GetLoader(update_path);
|
||||
|
||||
if (!update_loader)
|
||||
return {};
|
||||
return original_smdh;
|
||||
|
||||
std::vector<u8> update_smdh;
|
||||
update_loader->ReadIcon(update_smdh);
|
||||
update_loader->ReadProgramId(update_id);
|
||||
return update_smdh;
|
||||
}();
|
||||
|
||||
emit EntryReady({
|
||||
new GameListItemPath(QString::fromStdString(physical_name), smdh, program_id,
|
||||
update_smdh),
|
||||
new GameListItemPath(QString::fromStdString(physical_name), smdh, program_id),
|
||||
new GameListItem(
|
||||
QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType()))),
|
||||
new GameListItemSize(FileUtil::GetSize(physical_name)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue