Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

get

Manav Rathif2aee30f7cd8
diff --git a/web/apps/photos/src/services/download/index.ts b/web/apps/photos/src/services/download/index.ts
index aaaf788f26..aa9ca68b84 100644
--- a/web/apps/photos/src/services/download/index.ts
+++ b/web/apps/photos/src/services/download/index.ts
@@ -172,9 +172,9 @@ class DownloadManagerImpl {
if (!this.ready) {
throw Error(CustomError.DOWNLOAD_MANAGER_NOT_READY);
}
- const cachedThumb = await this.getCachedThumbnail(file.id);
+ const cachedThumb = await this.thumbnailCache.get(`${file.id}`);
if (cachedThumb) {
- return cachedThumb;
+ return new Uint8Array(await cachedThumb.arrayBuffer());
}
if (localOnly) {
return null;
diff --git a/web/packages/next/blob-cache.ts b/web/packages/next/blob-cache.ts
index 64ab4a44f2..25f1c76bfa 100644
--- a/web/packages/next/blob-cache.ts
+++ b/web/packages/next/blob-cache.ts
@@ -110,6 +110,10 @@ export const openCache = async (
*
* Also note that a File is a Blob!
*
+ * To convert from a Blob to ArrayBuffer
+ *
+ * await blob.arrayBuffer()
+ *
* Refs:
* - https://github.com/yigitunallar/arraybuffer-vs-blob
* - https://stackoverflow.com/questions/11821096/what-is-the-difference-between-an-arraybuffer-and-a-blob