From 6bd51c9ed34a3d2cc8db0ac0f7aca89414d6eca3 Mon Sep 17 00:00:00 2001 From: Sude Date: Mon, 17 Nov 2014 15:32:06 +0200 Subject: [PATCH] Fix using --update-cache with --use-cache --- src/downloader.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/downloader.cpp b/src/downloader.cpp index e7bcfdb..e209260 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -209,7 +209,7 @@ void Downloader::getGameList() */ int Downloader::getGameDetails() { - if (config.bUseCache) + if (config.bUseCache && !config.bUpdateCache) { int result = this->loadGameDetailsCache(); if (result == 0) @@ -2720,6 +2720,13 @@ int Downloader::loadGameDetailsCache() int Downloader::saveGameDetailsCache() { int res = 0; + + // Don't try to save cache if we don't have any game details + if (this->games.empty()) + { + return 1; + } + std::string cachepath = config.sCacheDirectory + "/gamedetails.json"; Json::Value json;