summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/GameFileCache.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2019-08-13 18:01:27 +0200
committerJosJuice <josjuice@gmail.com>2019-09-25 12:25:33 +0200
commit59f27ae4e1713d922fe71fc6ba95fbc399aac814 (patch)
tree06200f016eba6dd38fbee1067232490b6d5af14d /Source/Core/UICommon/GameFileCache.cpp
parentedfb0f66b6685fe1d4314ca27cce9492a7937683 (diff)
GameFile: Support HBC-style XML metadata
This feature was originally exclusive to the previous iteration of DolphinQt (the one that was the reason for the current iteration being named DolphinQt2 initially). https://bugs.dolphin-emu.org/issues/8949
Diffstat (limited to 'Source/Core/UICommon/GameFileCache.cpp')
-rw-r--r--Source/Core/UICommon/GameFileCache.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/Core/UICommon/GameFileCache.cpp b/Source/Core/UICommon/GameFileCache.cpp
index fa83ed66e0..07cbf726c4 100644
--- a/Source/Core/UICommon/GameFileCache.cpp
+++ b/Source/Core/UICommon/GameFileCache.cpp
@@ -27,7 +27,7 @@
namespace UICommon
{
-static constexpr u32 CACHE_REVISION = 15; // Last changed in PR 7816
+static constexpr u32 CACHE_REVISION = 16; // Last changed in PR 8313
std::vector<std::string> FindAllGamePaths(const std::vector<std::string>& directories_to_scan,
bool recursive_scan)
@@ -166,6 +166,7 @@ bool GameFileCache::UpdateAdditionalMetadata(
bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr<GameFile>* game_file)
{
+ const bool xml_metadata_changed = (*game_file)->XMLMetadataChanged();
const bool wii_banner_changed = (*game_file)->WiiBannerChanged();
const bool custom_banner_changed = (*game_file)->CustomBannerChanged();
@@ -174,14 +175,18 @@ bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr<GameFile>* game_fil
const bool default_cover_changed = (*game_file)->DefaultCoverChanged();
const bool custom_cover_changed = (*game_file)->CustomCoverChanged();
- if (!wii_banner_changed && !custom_banner_changed && !default_cover_changed &&
- !custom_cover_changed)
+ if (!xml_metadata_changed && !wii_banner_changed && !custom_banner_changed &&
+ !default_cover_changed && !custom_cover_changed)
+ {
return false;
+ }
// If a cached file needs an update, apply the updates to a copy and delete the original.
// This makes the usage of cached files in other threads safe.
std::shared_ptr<GameFile> copy = std::make_shared<GameFile>(**game_file);
+ if (xml_metadata_changed)
+ copy->XMLMetadataCommit();
if (wii_banner_changed)
copy->WiiBannerCommit();
if (custom_banner_changed)