feat: Trafero v0.2.0 - Tdarr v2 native Android client with slow-connection resilience

Full client for the Tdarr /api/v2 JSON API (jobs, library, nodes, stats, logs, settings, flows, multi-server switcher) plus v0.2.0 resilience: per-server timeout + slow-connection mode, retry-with-backoff on read polls, last-good-data + reconnecting chip, 60s poll backoff after repeated failures, and keep-alive eviction on app resume.

Includes GPL-3.0 licensing (LICENSE/NOTICE), README, CONTRIBUTING, PREVIOUS_HISTORY, issue/PR templates, CI release-notes script, keystore docs and the vendored OpenAPI 2.0 spec.
This commit is contained in:
nick committed 2026-09-21 17:46:29 +12:00
commit 312858e8f6
50 files changed
+4446

No files matched your search

+88
View File
@@ -0,0 +1,88 @@
#!/usr/bin/env python3
"""Extract the release-notes section for one version from PREVIOUS_HISTORY.md.
Trafero publishes its user-facing changelog through the Gitea Releases page:
for every tag push, `.gitea/workflows/release.yml` calls this script with
the released version. The matching `## v<VERSION> — <DATE>` section of
PREVIOUS_HISTORY.md becomes the release description and is also uploaded
next to the APKs as `Trafero-<VERSION>-changes.md`.
Usage:
release-notes.py <version> [--out FILE] [--history FILE] [--no-footer]
Exits 0 and prints the Markdown (to --out FILE or stdout) when the section
exists; exits 1 (message on stderr) when it doesn't — the workflow then
falls back to its generic "Release <tag>" body.
"""
import argparse
import re
import sys
from pathlib import Path
# "## v0.3.8.0 — 2026-09-16" -> group(1) = "0.3.8.0"
HEADING = re.compile(r"^##\s+v?([0-9]+(?:\.[0-9]+)*)\b")
FOOTER = (
"\n\n---\n\n"
"_Full history: PREVIOUS_HISTORY.md at the repository root. "
"In-depth developer notes: Trafero Development Plan \u00a710._\n"
)
def extract(history_text: str, version: str, footer: bool) -> str | None:
wanted = version.lstrip("vV").strip()
collected: list[str] = []
in_section = False
for line in history_text.splitlines():
match = HEADING.match(line)
if match:
in_section = match.group(1) == wanted
if in_section:
collected.append(line)
if not collected:
return None
body = "\n".join(collected).rstrip()
if not body:
return None
return body + (FOOTER if footer else "")
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("version", help="Version or tag, e.g. 0.3.8.0 or v0.3.8.0")
parser.add_argument("--out", type=Path, default=None,
help="Write the notes to this file instead of stdout")
parser.add_argument("--history", type=Path, default=None,
help="Path to PREVIOUS_HISTORY.md "
"(default: repo root, two levels above scripts/ci/)")
parser.add_argument("--no-footer", action="store_true",
help="Omit the standard cross-reference footer")
args = parser.parse_args()
history_path = args.history or (
Path(__file__).resolve().parents[2] / "PREVIOUS_HISTORY.md"
)
if not history_path.is_file():
print(f"release-notes: history file not found: {history_path}",
file=sys.stderr)
return 1
notes = extract(history_path.read_text(encoding="utf-8"),
args.version, footer=not args.no_footer)
if notes is None:
print(f"release-notes: no changelog section for {args.version} "
f"in {history_path.name}", file=sys.stderr)
return 1
if args.out:
args.out.write_text(notes, encoding="utf-8")
print(f"Wrote {len(notes)} chars for v{args.version.lstrip('vV')} "
f"to {args.out}")
else:
sys.stdout.write(notes)
return 0
if __name__ == "__main__":
sys.exit(main())