mirror of
https://github.com/deunix-educ/PyQuest.git
synced 2026-11-25 08:19:44 +01:00
Offline Piper narration: downloadable voices (settings), automatic level prefetch, durable audio and Pyodide caches
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,8 @@ def main() -> int:
|
||||
precache = shell_files()
|
||||
worker = DIST / "service-worker.js"
|
||||
source = worker.read_text(encoding="utf-8")
|
||||
pyodide_version = (pyodide / ".version").read_text(encoding="utf-8").strip() if (pyodide / ".version").exists() else "dev"
|
||||
source = re.sub(r"const PYODIDE_CACHE = '[^']*';", f"const PYODIDE_CACHE = 'pyquest-pyodide-{pyodide_version}';", source)
|
||||
source, shell_count = re.subn(r"const SHELL = \[.*?\];", f"const SHELL = {json.dumps(precache)};", source, flags=re.S)
|
||||
source, version_count = re.subn(
|
||||
r"const CACHE_VERSION = '[^']*';", f"const CACHE_VERSION = 'pyquest-{content_hash(precache)}';", source
|
||||
|
||||
Reference in New Issue
Block a user