Skip to main content

Module thumbnails

Module thumbnails 

Source
Expand description

Thumbnail cache and image-URL commands.

TRACES: UR-007 | JA-028 | DR-016

Structsยง

GetImageRequest
Request to get an image URL (with caching)

Staticsยง

IMAGE_DOWNLOAD_SEMAPHORE ๐Ÿ”’
Limit concurrent image downloads to avoid saturating the connection pool. Without this, rendering a page with hundreds of album cards fires hundreds of concurrent HTTP requests, starving API calls and causing timeouts.

Functionsยง

image_get_url
Get image as base64 data URL, caching if not already cached This extends the thumbnail system to serve all images through Rust with automatic caching
image_semaphore ๐Ÿ”’
mime_from_ext ๐Ÿ”’
thumbnail_clear_cache
Clear all cached thumbnails
thumbnail_delete_item
Delete cached thumbnails for a specific item
thumbnail_get_cached
Get cached thumbnail path, returns None if not cached Also updates last_accessed timestamp for LRU tracking
thumbnail_get_stats
Get thumbnail cache statistics
thumbnail_save
Download and save a thumbnail to cache Returns the local file path on success
thumbnail_set_limit
Set thumbnail cache storage limit in bytes