The curator Python backend (package, tests, systemd units, config templates, scripts) now lives under scenarios/curator/backend and is the single source of truth; the live checkout at the workspace path is a runtime copy. Exported from the app repo's tracked tree via git archive (no history, .pi/venv/caches excluded). 149 unit tests pass from the new location. profile.toml backend is now repo-relative (scenarios/curator/backend); verify-generated.sh resolves a relative backend against REPO_ROOT. verify-no-secrets ASSIGN heuristic now requires value entropy so vendored kwargs like token=extraction_token no longer false-positive. README documents the backend/ layout and the operator-owned app rollout step.
15 lines
417 B
Python
15 lines
417 B
Python
from __future__ import annotations
|
|
|
|
import urllib.parse
|
|
|
|
|
|
def book_search_url(template: str, title: str, creator: str = "") -> str:
|
|
base = template.strip()
|
|
if not base:
|
|
return ""
|
|
query = " ".join(value.strip() for value in (title, creator) if value.strip())
|
|
encoded = urllib.parse.quote(query, safe="")
|
|
if "{query}" in base:
|
|
return base.replace("{query}", encoded)
|
|
return base
|