diff --git a/Telegram/SourceFiles/chat_helpers/stickers_lottie.cpp b/Telegram/SourceFiles/chat_helpers/stickers_lottie.cpp index c10c5e95c0..e9bc231498 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_lottie.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_lottie.cpp @@ -158,7 +158,7 @@ std::unique_ptr LottieThumbnail( QSize box, std::shared_ptr renderer) { const auto baseKey = thumb - ? thumb->owner()->thumbnailLocation().file().bigFileBaseCacheKey() + ? thumb->owner()->thumbnailBigFileBaseCacheKey() : media ? media->owner()->bigFileBaseCacheKey() : Storage::Cache::Key(); diff --git a/Telegram/SourceFiles/data/stickers/data_stickers_set.cpp b/Telegram/SourceFiles/data/stickers/data_stickers_set.cpp index 56e69bae21..3e48951908 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers_set.cpp +++ b/Telegram/SourceFiles/data/stickers/data_stickers_set.cpp @@ -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(&location)) { + return storage->bigFileBaseCacheKey(); + } + return {}; +} + int StickersSet::thumbnailByteSize() const { return _thumbnail.byteSize; } diff --git a/Telegram/SourceFiles/data/stickers/data_stickers_set.h b/Telegram/SourceFiles/data/stickers/data_stickers_set.h index 7bd0987334..03fc0c019b 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers_set.h +++ b/Telegram/SourceFiles/data/stickers/data_stickers_set.h @@ -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 createThumbnailView();