From 59f27ae4e1713d922fe71fc6ba95fbc399aac814 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 13 Aug 2019 18:01:27 +0200 Subject: 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 --- Source/Core/UICommon/GameFileCache.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Source/Core/UICommon/GameFileCache.cpp') 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 FindAllGamePaths(const std::vector& directories_to_scan, bool recursive_scan) @@ -166,6 +166,7 @@ bool GameFileCache::UpdateAdditionalMetadata( bool GameFileCache::UpdateAdditionalMetadata(std::shared_ptr* 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* 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 copy = std::make_shared(**game_file); + if (xml_metadata_changed) + copy->XMLMetadataCommit(); if (wii_banner_changed) copy->WiiBannerCommit(); if (custom_banner_changed) -- cgit v1.2.3