mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-04 08:35:21 +00:00
Use Storage::Cache::Database for file caching.
This commit is contained in:
@@ -126,6 +126,9 @@ void Uploader::uploadMedia(const FullMsgId &msgId, const SendMediaReady &media)
|
||||
: Auth().data().document(media.document, media.photoThumbs.begin().value());
|
||||
if (!media.data.isEmpty()) {
|
||||
document->setData(media.data);
|
||||
if (document->saveToCache()) {
|
||||
Auth().data().cache().put(document->cacheKey(), media.data);
|
||||
}
|
||||
}
|
||||
if (!media.file.isEmpty()) {
|
||||
document->setLocation(FileLocation(media.file));
|
||||
@@ -148,6 +151,11 @@ void Uploader::upload(
|
||||
document->uploadingData = std::make_unique<Data::UploadState>(document->size);
|
||||
if (!file->content.isEmpty()) {
|
||||
document->setData(file->content);
|
||||
if (document->saveToCache()) {
|
||||
Auth().data().cache().put(
|
||||
document->cacheKey(),
|
||||
file->content);
|
||||
}
|
||||
}
|
||||
if (!file->filepath.isEmpty()) {
|
||||
document->setLocation(FileLocation(file->filepath));
|
||||
|
Reference in New Issue
Block a user