파일을 업로드할 때 캐시에 저장하고 동영상을 스트리밍하는 과정에서도 청크 단위로 캐시에 저장하여 다음 재생에 활용하도록 개선

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
staticandClaude Opus 5.5 committed 2026-10-12 01:40:03 +09:00
1 parent 06fdfcc447
commit 225ad3515f
12 files changed
+449 -112

No files matched your search

+1 -12
View File
@@ -26,18 +26,7 @@ export const getFileStreamUrl = async ({ id, isLegacy, dataKey, contentType }: S
throw new Error("Data key not loaded");
}
const res = await fetch(`/api/file/${id}/download`, { method: "HEAD" });
if (!res.ok) {
throw new Error("Failed to get the file size");
}
const encContentSize = parseInt(res.headers.get("Content-Length") ?? "0", 10);
await prepareFileDecryption(id, {
isLegacy: !!isLegacy,
dataKey: dataKey.key,
encContentSize,
contentType,
});
await prepareFileDecryption(id, { isLegacy: !!isLegacy, dataKey: dataKey.key, contentType });
return getDecryptedFileUrl(id);
};
+1 -1
View File
@@ -2,7 +2,7 @@ import { storeFileThumbnailCache } from "#lib/client/cache/index.js";
import { uploadFile as doUploadFile } from "#lib/client/transfer/index.js";
import { invalidateDirectory } from "./directory";
// Uploads the file and caches its thumbnail locally. Returns `false` if the upload is canceled.
// Uploads the file and caches it with its thumbnail locally. Returns `false` if the upload is canceled.
export const uploadFile = async (
file: File,
parentId: DirectoryId,