mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-06-06 01:13:45 -04:00
service/aoc: refresh add-on content list before queries
This commit is contained in:
parent
1cfc2b22ef
commit
e11d86e081
2 changed files with 12 additions and 2 deletions
|
|
@ -42,8 +42,9 @@ static std::vector<u64> AccumulateAOCTitleIDs(Core::System& system) {
|
|||
std::remove_if(
|
||||
add_on_content.begin(), add_on_content.end(),
|
||||
[&rcu](u64 tid) {
|
||||
return rcu.GetEntry(tid, FileSys::ContentRecordType::Data)->GetStatus() !=
|
||||
Loader::ResultStatus::Success;
|
||||
auto entry = rcu.GetEntry(tid, FileSys::ContentRecordType::Data);
|
||||
return entry == nullptr ||
|
||||
entry->GetStatus() != Loader::ResultStatus::Success;
|
||||
}),
|
||||
add_on_content.end());
|
||||
return add_on_content;
|
||||
|
|
@ -88,9 +89,15 @@ IAddOnContentManager::~IAddOnContentManager() {
|
|||
service_context.CloseEvent(aoc_change_event);
|
||||
}
|
||||
|
||||
void IAddOnContentManager::RefreshAddOnContentList() {
|
||||
add_on_content = AccumulateAOCTitleIDs(system);
|
||||
}
|
||||
|
||||
Result IAddOnContentManager::CountAddOnContent(Out<u32> out_count, ClientProcessId process_id) {
|
||||
LOG_DEBUG(Service_AOC, "called. process_id={}", process_id.pid);
|
||||
|
||||
RefreshAddOnContentList();
|
||||
|
||||
const auto current = system.GetApplicationProcessProgramID();
|
||||
|
||||
const auto& disabled = Settings::values.disabled_addons[current];
|
||||
|
|
@ -112,6 +119,8 @@ Result IAddOnContentManager::ListAddOnContent(Out<u32> out_count,
|
|||
LOG_DEBUG(Service_AOC, "called with offset={}, count={}, process_id={}", offset, count,
|
||||
process_id.pid);
|
||||
|
||||
RefreshAddOnContentList();
|
||||
|
||||
const auto current = FileSys::GetBaseTitleID(system.GetApplicationProcessProgramID());
|
||||
|
||||
std::vector<u32> out;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public:
|
|||
OutInterface<IPurchaseEventManager> out_interface);
|
||||
|
||||
private:
|
||||
void RefreshAddOnContentList();
|
||||
std::vector<u64> add_on_content;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue