mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-21 00:23:56 +08:00
Clear directly-deleted local photos from cache.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user