MCPcopy
hub / github.com/codedogQBY/ReadAny / getCachedBlob

Function getCachedBlob

packages/app/src/components/reader/ReaderView.tsx:136–148  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

134}
135
136async function getCachedBlob(filePath: string): Promise<Blob> {
137 const cached = fileBlobCache.get(filePath);
138 if (cached) return cached;
139
140 const blob = await loadFileAsBlob(filePath);
141
142 if (fileBlobCache.size >= MAX_CACHE_SIZE) {
143 const firstKey = fileBlobCache.keys().next().value;
144 if (firstKey) fileBlobCache.delete(firstKey);
145 }
146 fileBlobCache.set(filePath, blob);
147 return blob;
148}
149
150function getTTSSegmentIdentity(
151 segment: { text?: string | null; cfi?: string | null } | null | undefined,

Callers 1

loadAndParseBookFunction · 0.70

Calls 4

loadFileAsBlobFunction · 0.85
getMethod · 0.65
nextMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected