From bc588948c9c3de53af0a791535f9ae8cbf4093ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Tue, 4 Jul 2017 14:15:22 +0200 Subject: [PATCH] WiiUtils: Move ShouldInstallTitle to the online updater The disc updater uses different conditions. --- Source/Core/Core/WiiUtils.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Core/Core/WiiUtils.cpp b/Source/Core/Core/WiiUtils.cpp index 6940123fa3..aaaacff91b 100644 --- a/Source/Core/Core/WiiUtils.cpp +++ b/Source/Core/Core/WiiUtils.cpp @@ -118,7 +118,6 @@ protected: std::string GetDeviceRegion(); std::string GetDeviceId(); - bool ShouldInstallTitle(const TitleInfo& title); IOS::HLE::Kernel m_ios; }; @@ -149,14 +148,6 @@ std::string SystemUpdater::GetDeviceId() return StringFromFormat("%" PRIu64, (u64(1) << 32) | ios_device_id); } -bool SystemUpdater::ShouldInstallTitle(const TitleInfo& title) -{ - const auto es = m_ios.GetES(); - const auto installed_tmd = es->FindInstalledTMD(title.id); - return !(installed_tmd.IsValid() && installed_tmd.GetTitleVersion() >= title.version && - es->GetStoredContentsFromTMD(installed_tmd).size() == installed_tmd.GetNumContents()); -} - class OnlineSystemUpdater final : public SystemUpdater { public: @@ -172,6 +163,7 @@ private: Response GetSystemTitles(); Response ParseTitlesResponse(const std::vector& response) const; + bool ShouldInstallTitle(const TitleInfo& title); UpdateResult InstallTitleFromNUS(const std::string& prefix_url, const TitleInfo& title, std::unordered_set* updated_titles); @@ -241,6 +233,14 @@ OnlineSystemUpdater::ParseTitlesResponse(const std::vector& response) const return info; } +bool OnlineSystemUpdater::ShouldInstallTitle(const TitleInfo& title) +{ + const auto es = m_ios.GetES(); + const auto installed_tmd = es->FindInstalledTMD(title.id); + return !(installed_tmd.IsValid() && installed_tmd.GetTitleVersion() >= title.version && + es->GetStoredContentsFromTMD(installed_tmd).size() == installed_tmd.GetNumContents()); +} + constexpr const char* GET_SYSTEM_TITLES_REQUEST_PAYLOAD = R"(