Add forward skip to mini player, home-screen app support, cover fallback
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1df566d85d
commit
7f59c6d27b
7 files changed
+41
-10
No files matched your search
@@ -39,6 +39,10 @@ F_LEGACY = os.path.join(DATA, "progress.json") # single-user file from the
|
||||
COOKIE = "oa_session"
|
||||
SESSION_DAYS = 90
|
||||
|
||||
# Files the browser fetches without a session (home-screen icon and manifest).
|
||||
PUBLIC = {"/manifest.webmanifest": "application/manifest+json", "/icon-180.png": "image/png",
|
||||
"/icon-192.png": "image/png", "/icon-512.png": "image/png"}
|
||||
|
||||
# Only read-only endpoints needed for listening are reachable; admin commands/import are not.
|
||||
ALLOWED = [re.compile(p) for p in (
|
||||
r"^/api/books$",
|
||||
@@ -153,7 +157,7 @@ def cli(argv):
|
||||
# ---------- login page ----------
|
||||
LOGIN = """<!doctype html><html lang=en><meta charset=utf-8>
|
||||
<meta name=viewport content="width=device-width,initial-scale=1,viewport-fit=cover">
|
||||
<meta name=theme-color content="#0f0f12"><title>Sign in</title>
|
||||
<meta name=theme-color content="#0f0f12"><meta name=apple-mobile-web-app-capable content=yes><link rel=manifest href=/manifest.webmanifest><link rel=apple-touch-icon href=/icon-180.png><title>Sign in</title>
|
||||
<style>
|
||||
:root{color-scheme:light dark;--bg:#f6f6f4;--s:#fff;--fg:#16161a;--m:#74747c;--a:#e8590c;--b:rgba(0,0,0,.1)}
|
||||
@media(prefers-color-scheme:dark){:root{--bg:#0f0f12;--s:#1a1a1f;--fg:#f2f2f4;--m:#8f8f99;--a:#ff7a2f;--b:rgba(255,255,255,.1)}}
|
||||
@@ -217,6 +221,9 @@ class Handler(BaseHTTPRequestHandler):
|
||||
return self.send_body(200, LOGIN, "text/html; charset=utf-8")
|
||||
if path == "/logout":
|
||||
return self.logout()
|
||||
if path in PUBLIC:
|
||||
with open(os.path.join(HERE, path[1:]), "rb") as f:
|
||||
return self.send_body(200, f.read(), PUBLIC[path], [("Cache-Control", "public, max-age=86400")])
|
||||
user = self.user()
|
||||
if not user:
|
||||
return self.deny(path)
|
||||
|
||||
Reference in new issue
Block a user