From 7a7efc88f5ed7fc06eb85b95d263d6a98b04a02a Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 4 Feb 2021 01:00:29 +0100 Subject: [PATCH] changed saving artwork info cache only if it has changed --- src/libgame/setup.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 7c864576..bfe8d94b 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -96,6 +96,7 @@ static SetupFileHash *artworkinfo_cache_old = NULL; static SetupFileHash *artworkinfo_cache_new = NULL; static SetupFileHash *optional_tokens_hash = NULL; static boolean use_artworkinfo_cache = TRUE; +static boolean update_artworkinfo_cache = FALSE; // ---------------------------------------------------------------------------- @@ -2972,10 +2973,15 @@ static void LoadArtworkInfoCache(void) if (artworkinfo_cache_new == NULL) artworkinfo_cache_new = newSetupFileHash(); + + update_artworkinfo_cache = FALSE; } static void SaveArtworkInfoCache(void) { + if (!update_artworkinfo_cache) + return; + char *filename = getPath2(getCacheDir(), ARTWORKINFO_CACHE_FILE); InitCacheDirectory(); @@ -4000,6 +4006,8 @@ static void LoadArtworkInfoFromLevelInfoExt(ArtworkDirTree **artwork_node, artwork_new->sort_priority = level_node->sort_priority; artwork_new->color = LEVELCOLOR(artwork_new); + + update_artworkinfo_cache = TRUE; } free(path); -- 2.34.1