Laev.SubtitleCache (laev v0.1.40)

Copy Markdown View Source

In-memory cache of converted subtitle VTT, keyed by source. Prevents re-downloading the same subtitle on every page reload — important for OpenSubtitles, whose downloads count against a small daily quota.

Summary

Functions

Return the cached VTT for key, else run fun (-> {:ok, vtt} | {:error, _}) and cache success.

Functions

fetch(key, fun)

Return the cached VTT for key, else run fun (-> {:ok, vtt} | {:error, _}) and cache success.

init()