mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
썸네일이 누락된 파일 조회 및 레거시 파일 조회 네트워크 호출 최적화
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as IndexedDB from "$lib/indexedDB";
|
||||
import { trpc, isTRPCClientError } from "$trpc/client";
|
||||
import { FilesystemCache, decryptFileMetadata, decryptCategoryMetadata } from "./internal.svelte";
|
||||
import { decryptFileMetadata, decryptCategoryMetadata } from "./common";
|
||||
import { FilesystemCache, type FilesystemCacheOptions } from "./FilesystemCache.svelte";
|
||||
import type { FileInfo, MaybeFileInfo } from "./types";
|
||||
|
||||
const cache = new FilesystemCache<number, MaybeFileInfo>({
|
||||
@@ -168,8 +169,12 @@ const bulkStoreToIndexedDB = (infos: FileInfo[]) => {
|
||||
return infos.map((info) => [info.id, { ...info, exists: true }] as const);
|
||||
};
|
||||
|
||||
export const getFileInfo = (id: number, masterKey: CryptoKey) => {
|
||||
return cache.get(id, masterKey);
|
||||
export const getFileInfo = (
|
||||
id: number,
|
||||
masterKey: CryptoKey,
|
||||
options?: { fetchFromServer?: FilesystemCacheOptions<number, MaybeFileInfo>["fetchFromServer"] },
|
||||
) => {
|
||||
return cache.get(id, masterKey, options);
|
||||
};
|
||||
|
||||
export const bulkGetFileInfo = (ids: number[], masterKey: CryptoKey) => {
|
||||
|
||||
Reference in New Issue
Block a user