mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Fix download task finalizing.
This commit is contained in:
@@ -617,10 +617,17 @@ void DocumentData::updateThumbnails(
|
||||
|| _thumbnailLocation.height() < thumbnail.location.height())) {
|
||||
_thumbnailLocation = thumbnail.location;
|
||||
_thumbnailByteSize = thumbnail.bytesCount;
|
||||
if (_thumbnailLoader) {
|
||||
if (!thumbnail.preloaded.isNull()) {
|
||||
_thumbnailLoader = nullptr;
|
||||
if (const auto media = activeMediaView()) {
|
||||
media->setThumbnail(thumbnail.preloaded);
|
||||
}
|
||||
} else if (_thumbnailLoader) {
|
||||
const auto origin = base::take(_thumbnailLoader)->fileOrigin();
|
||||
loadThumbnail(origin);
|
||||
// #TODO optimize replace thumbnail in activeMediaView().
|
||||
}
|
||||
if (!thumbnail.bytes.isEmpty()) {
|
||||
// #TODO optimize put to cache
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user