static SetupFileHash *artworkinfo_cache_new = NULL;
static SetupFileHash *optional_tokens_hash = NULL;
static boolean use_artworkinfo_cache = TRUE;
+static boolean update_artworkinfo_cache = FALSE;
// ----------------------------------------------------------------------------
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();
if (timestamp_string == NULL)
return TRUE;
+ if (!fileExists(filename)) // file does not exist
+ return (atoi(timestamp_string) != 0);
+
if (stat(filename, &file_status) != 0) // cannot stat file
return TRUE;
artwork_new->sort_priority = level_node->sort_priority;
artwork_new->color = LEVELCOLOR(artwork_new);
+
+ update_artworkinfo_cache = TRUE;
}
free(path);