Add StickersSet::thumbnailBigFileBaseCacheKey.

This commit is contained in:
John Preston 2021-10-21 14:58:15 +04:00
parent 9075489c18
commit 7bc4b2c595
3 changed files with 10 additions and 1 deletions

View File

@ -158,7 +158,7 @@ std::unique_ptr<Lottie::SinglePlayer> LottieThumbnail(
QSize box,
std::shared_ptr<Lottie::FrameRenderer> renderer) {
const auto baseKey = thumb
? thumb->owner()->thumbnailLocation().file().bigFileBaseCacheKey()
? thumb->owner()->thumbnailBigFileBaseCacheKey()
: media
? media->owner()->bigFileBaseCacheKey()
: Storage::Cache::Key();

View File

@ -151,6 +151,14 @@ const ImageLocation &StickersSet::thumbnailLocation() const {
return _thumbnail.location;
}
Storage::Cache::Key StickersSet::thumbnailBigFileBaseCacheKey() const {
const auto &location = _thumbnail.location.file().data;
if (const auto storage = std::get_if<StorageFileLocation>(&location)) {
return storage->bigFileBaseCacheKey();
}
return {};
}
int StickersSet::thumbnailByteSize() const {
return _thumbnail.byteSize;
}

View File

@ -87,6 +87,7 @@ public:
[[nodiscard]] bool thumbnailFailed() const;
void loadThumbnail();
[[nodiscard]] const ImageLocation &thumbnailLocation() const;
[[nodiscard]] Storage::Cache::Key thumbnailBigFileBaseCacheKey() const;
[[nodiscard]] int thumbnailByteSize() const;
[[nodiscard]] std::shared_ptr<StickersSetThumbnailView> createThumbnailView();