Expand description
Two-tier (memory + disk) thumbnail cache for the library grid.
Remote thumbnails are fetched via the API client and decoded into GDK textures. An LRU memory cache with a configurable byte budget keeps hot textures in RAM, while a persistent disk cache avoids redundant network requests across sessions. In-flight deduplication ensures concurrent requests for the same asset coalesce into one load.
StructsΒ§
- Inflight
Guard π - Guard that cleans up in-flight channel entries on drop.
- Sized
LruCache π - LRU Cache that limits memory usage based on estimated byte size.
- Thumbnail
Cache - A combined memory (LRU) and disk-based caching manager for remote and local assets.
ConstantsΒ§
- FALLBACK_
CPUS π - LARGE_
LOAD_ πMAX - SMALL_
LOAD_ πMAX
FunctionsΒ§
- auto_
memory_ πbudget - Pick a thumbnail-cache RAM budget from
MemTotalin/proc/meminfo, clamped to[AUTO_MIN_BYTES, AUTO_MAX_BYTES]. Falls back to the floor if the file canβt be read. - await_
inflight π - Helper to await an in-flight thumbnail load result from a subscriber channel.
- cache_
key π - Construct a cache key string for remote assets.
- custom_
decode_ πto_ thumbnail - Decodes an image file through the applicationβs custom texture pipeline and scale the result down to a 256x256 thumbnail pixbuf.
- decode_
local_ πpixbuf - Decode a local file to a 256x256 thumbnail pixbuf, routing through video, RAW, or standard image pipelines as appropriate.
- decode_
to_ πscaled_ texture - Asynchronously decode image bytes into a scaled texture.
- encode_
png_ πbytes - estimate_
texture_ πbytes - Estimate memory byte size occupied by a texture.
- ffmpeg_
extract_ πthumbnail - Extract a thumbnail frame from a video file using
ffmpeg. - local_
cache_ πkey - Construct a cache key string for local assets using hashed paths.
- pack_
pixel_ πrows - pixbuf_
png_ πbytes - read_
meminfo_ πtotal_ bytes - run_
ffmpeg_ πframe - Run ffmpeg to extract a single frame at the given seek position.
- scale_
pixbuf_ πto_ thumbnail - Scale a pixbuf down to fit within 256x256 if needed.
- target_
dim_ πfor_ bucket
Type AliasesΒ§
- Inflight
Map π - Inflight
Rx π - Inflight
Slot π