add wonky image loading

This commit is contained in:
ouwou
2020-09-30 00:12:38 -04:00
parent 1460d89140
commit 4ac27e9140
10 changed files with 239 additions and 20 deletions

View File

@@ -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();) {