mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 22:57:11 +02:00
Add StickersSet::thumbnailBigFileBaseCacheKey.
This commit is contained in:
parent
9075489c18
commit
7bc4b2c595
3 changed files with 10 additions and 1 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue