Web disk cache: handle the Matte kind (mattes/ folder)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
vangel76
2026-10-12 19:08:21 +02:00
co-authored by Claude Sonnet 5.5
parent 4acea86d4f
commit 925760c9c8
2 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -404,7 +404,7 @@ export function frameWorkerStart(base, onMessage, gpu) {
// ends in a checksum) and read the layer buffers they prefetch; the page lists, reads and
// deletes.
const CACHE_ROOT = "effectcraft-cache";
const CACHE_KINDS = ["frames", "layers"];
const CACHE_KINDS = ["frames", "layers", "mattes"];
const cacheDirHandles = {};
async function cacheDir(kind = "frames") {
@@ -419,6 +419,7 @@ async function cacheDir(kind = "frames") {
/// The folder and file name of an entry name (`layers/<hex>.ecc` or `<hex>.ecc`).
async function entryDir(name) {
if (name.startsWith("layers/")) return [await cacheDir("layers"), name.slice(7)];
if (name.startsWith("mattes/")) return [await cacheDir("mattes"), name.slice(7)];
return [await cacheDir("frames"), name];
}