summaryrefslogtreecommitdiff
path: root/filecache.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-09-30 00:12:38 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2020-09-30 00:12:38 -0400
commit4ac27e91403b708088451c9c07f3b4c2eecb7cf2 (patch)
tree76c2256ae1786c9c25ee71169bcb5877b5089c2b /filecache.cpp
parent1460d891409b019de2a8702b9036c8d2ed602765 (diff)
downloadabaddon-portaudio-4ac27e91403b708088451c9c07f3b4c2eecb7cf2.tar.gz
abaddon-portaudio-4ac27e91403b708088451c9c07f3b4c2eecb7cf2.zip
add wonky image loading
Diffstat (limited to 'filecache.cpp')
-rw-r--r--filecache.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/filecache.cpp b/filecache.cpp
index 7d1bdb4..9220ae8 100644
--- a/filecache.cpp
+++ b/filecache.cpp
@@ -51,6 +51,15 @@ void Cache::GetFileFromURL(std::string url, callback_type cb) {
}
}
+std::string Cache::GetPathIfCached(std::string url) {
+ auto cache_path = m_tmp_path / SanitizeString(url);
+ if (std::filesystem::exists(cache_path)) {
+ return cache_path.string();
+ }
+
+ return "";
+}
+
// this just seems really yucky
void Cache::CleanupFutures() {
for (auto it = m_futures.begin(); it != m_futures.end();) {