patch_manager: Add getter for title version
This commit is contained in:
parent
221996a194
commit
a468273221
2 changed files with 14 additions and 2 deletions
|
@ -493,6 +493,16 @@ std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNam
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<u32> PatchManager::GetGameVersion() const {
|
||||||
|
const auto& installed = Core::System::GetInstance().GetContentProvider();
|
||||||
|
const auto update_tid = GetUpdateTitleID(title_id);
|
||||||
|
if (installed.HasEntry(update_tid, ContentRecordType::Program)) {
|
||||||
|
return installed.GetEntryVersion(update_tid);
|
||||||
|
}
|
||||||
|
|
||||||
|
return installed.GetEntryVersion(title_id);
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<std::unique_ptr<NACP>, VirtualFile> PatchManager::GetControlMetadata() const {
|
std::pair<std::unique_ptr<NACP>, VirtualFile> PatchManager::GetControlMetadata() const {
|
||||||
const auto& installed = Core::System::GetInstance().GetContentProvider();
|
const auto& installed = Core::System::GetInstance().GetContentProvider();
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,10 @@ public:
|
||||||
std::map<std::string, std::string, std::less<>> GetPatchVersionNames(
|
std::map<std::string, std::string, std::less<>> GetPatchVersionNames(
|
||||||
VirtualFile update_raw = nullptr) const;
|
VirtualFile update_raw = nullptr) const;
|
||||||
|
|
||||||
// Given title_id of the program, attempts to get the control data of the update and parse it,
|
std::optional<u32> GetGameVersion() const;
|
||||||
// falling back to the base control data.
|
|
||||||
|
// Given title_id of the program, attempts to get the control data of the update and parse
|
||||||
|
// it, falling back to the base control data.
|
||||||
std::pair<std::unique_ptr<NACP>, VirtualFile> GetControlMetadata() const;
|
std::pair<std::unique_ptr<NACP>, VirtualFile> GetControlMetadata() const;
|
||||||
|
|
||||||
// Version of GetControlMetadata that takes an arbitrary NCA
|
// Version of GetControlMetadata that takes an arbitrary NCA
|
||||||
|
|
Loading…
Reference in a new issue