summaryrefslogtreecommitdiff
path: root/src/client/clientmedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/clientmedia.cpp')
-rw-r--r--src/client/clientmedia.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/clientmedia.cpp b/src/client/clientmedia.cpp
index 6da99bbbf..8cd3b6bcc 100644
--- a/src/client/clientmedia.cpp
+++ b/src/client/clientmedia.cpp
@@ -35,6 +35,15 @@ static std::string getMediaCacheDir()
return porting::path_cache + DIR_DELIM + "media";
}
+bool clientMediaUpdateCache(const std::string &raw_hash, const std::string &filedata)
+{
+ FileCache media_cache(getMediaCacheDir());
+ std::string sha1_hex = hex_encode(raw_hash);
+ if (!media_cache.exists(sha1_hex))
+ return media_cache.update(sha1_hex, filedata);
+ return true;
+}
+
/*
ClientMediaDownloader
*/
@@ -559,7 +568,6 @@ bool ClientMediaDownloader::checkAndLoad(
return true;
}
-
/*
Minetest Hashset File Format