Clear directly-deleted local photos from cache.

This commit is contained in:
John Preston
2026-08-14 11:16:58 +04:00
parent 10988300fd
commit e2bc4cef5b
14 changed files with 366 additions and 99 deletions

View File

@@ -205,6 +205,21 @@ void PhotoData::cancel() {
}
}
void PhotoData::clearLocalCache() {
auto keys = base::flat_set<Storage::Cache::Key>();
for (auto &file : _images) {
if (const auto key = file.location.file().cacheKey()) {
keys.emplace(key);
}
if (file.loader) {
file.loader->cancel();
}
}
for (const auto &key : keys) {
_owner->cache().remove(key);
}
}
float64 PhotoData::progress() const {
if (uploading()) {
if (uploadingData->size > 0) {