| 139 | } |
| 140 | |
| 141 | bool IsImageCached(const std::string& images_dir, const ImageEntry& entry) { |
| 142 | std::string cache_dir = ImageCacheDir(images_dir, entry); |
| 143 | if (!fs::exists(cache_dir) || !fs::is_directory(cache_dir)) { |
| 144 | return false; |
| 145 | } |
| 146 | |
| 147 | for (const auto& file : entry.files) { |
| 148 | fs::path file_path = fs::path(cache_dir) / file.name; |
| 149 | if (!fs::exists(file_path)) { |
| 150 | return false; |
| 151 | } |
| 152 | fs::path tmp_path = fs::path(cache_dir) / (file.name + ".tmp"); |
| 153 | if (fs::exists(tmp_path)) { |
| 154 | return false; |
| 155 | } |
| 156 | } |
| 157 | return true; |
| 158 | } |
| 159 | |
| 160 | std::vector<ImageEntry> GetCachedImages(const std::string& images_dir) { |
| 161 | std::vector<ImageEntry> result; |
no test coverage detected