Add StickersSet::thumbnailBigFileBaseCacheKey.
This commit is contained in:
parent
9075489c18
commit
7bc4b2c595
|
@ -158,7 +158,7 @@ std::unique_ptr<Lottie::SinglePlayer> LottieThumbnail(
|
||||||
QSize box,
|
QSize box,
|
||||||
std::shared_ptr<Lottie::FrameRenderer> renderer) {
|
std::shared_ptr<Lottie::FrameRenderer> renderer) {
|
||||||
const auto baseKey = thumb
|
const auto baseKey = thumb
|
||||||
? thumb->owner()->thumbnailLocation().file().bigFileBaseCacheKey()
|
? thumb->owner()->thumbnailBigFileBaseCacheKey()
|
||||||
: media
|
: media
|
||||||
? media->owner()->bigFileBaseCacheKey()
|
? media->owner()->bigFileBaseCacheKey()
|
||||||
: Storage::Cache::Key();
|
: Storage::Cache::Key();
|
||||||
|
|
|
@ -151,6 +151,14 @@ const ImageLocation &StickersSet::thumbnailLocation() const {
|
||||||
return _thumbnail.location;
|
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 {
|
int StickersSet::thumbnailByteSize() const {
|
||||||
return _thumbnail.byteSize;
|
return _thumbnail.byteSize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,7 @@ public:
|
||||||
[[nodiscard]] bool thumbnailFailed() const;
|
[[nodiscard]] bool thumbnailFailed() const;
|
||||||
void loadThumbnail();
|
void loadThumbnail();
|
||||||
[[nodiscard]] const ImageLocation &thumbnailLocation() const;
|
[[nodiscard]] const ImageLocation &thumbnailLocation() const;
|
||||||
|
[[nodiscard]] Storage::Cache::Key thumbnailBigFileBaseCacheKey() const;
|
||||||
[[nodiscard]] int thumbnailByteSize() const;
|
[[nodiscard]] int thumbnailByteSize() const;
|
||||||
|
|
||||||
[[nodiscard]] std::shared_ptr<StickersSetThumbnailView> createThumbnailView();
|
[[nodiscard]] std::shared_ptr<StickersSetThumbnailView> createThumbnailView();
|
||||||
|
|
Loading…
Reference in New Issue