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

+57
View File
@@ -0,0 +1,57 @@
# Trafero
Native Android (Kotlin / Jetpack Compose / Material 3) client for the Tdarr server v2.2x+ /api/v2 JSON API.
**Current release:** v0.2.0 — full release notes ship on its entry on the
[Releases page](https://git.trevena.info/nick/Trafero/releases).
> **Installing a release APK over a debug build?** They are signed with
> different keys, so uninstall the debug app first — Android will refuse
> an in-place update across signatures. Release → release updates are
> normal in-place upgrades.
## Build
./gradlew assembleDebug
# app/build/outputs/apk/debug/app-debug.apk
Toolchain: JDK 17, Android SDK platform 35 + build-tools 35, Gradle 8.10.2 wrapper, AGP 8.7.2, Kotlin 2.0.21.
Release builds need the local dev keystore — see [`keystore/README.md`](keystore/README.md).
## Install & test
adb install -r app/build/outputs/apk/debug/app-debug.apk
## Features (v0.2.0)
- Connection wizard: custom URL (scheme/port normalization, default :8265), auth mode None / API key (x-api-key) / username+password (bearer token), self-signed TLS toggle, live test probe, multi-server switcher.
- Jobs: running workers (progress/fps/ETA, cancel), staged queue (approve/reject), history (file filter), error stacks (table1/2/3).
- Library: search + per-library filter + sort, paged file cards, detail bottom sheet (streams from ffprobe, plugin output, re-check).
- Nodes: pause/resume, worker limit +/-, kill worker, queue depths.
- Stats: server info, CPU/mem, totals, space saved, transcode/health donuts, codec mix.
- Logs: server log with filter + follow.
- Settings: pause-all-nodes & ignore-schedules, libraries (watch toggle, scan new / full scan), server CRUD.
- Flows: read-only flow-plugin catalog (inputs/filters/actions/variables/outputs).
- Polling interval picker (Off/5s/15s/30s/1m/5m) in app bar; Material You dynamic color, dark & light.
## v0.2.0 changes (slow-connection resilience)
- Per-server **timeout** field and **"Slow connection"** mode (doubles all timeouts) in the server editor; defaults 20 s connect / 90 s read.
- Read-style/polling calls auto-retry twice (2 s / 5 s backoff) on network failures only — user-triggered mutations are never repeated.
- Screens keep their last good data on transient failures and show a slim **"reconnecting…"** chip; full error banners are reserved for no-data, auth, or server errors. After 3 consecutive poll failures a screen backs off to a 60 s cadence.
- OkHttp keep-alive pool is evicted on app resume so stale NAT/LAN sockets can't cause phantom timeouts.
## Earlier changes
Full history lives in [`PREVIOUS_HISTORY.md`](PREVIOUS_HISTORY.md); each release on the Releases page carries its own notes plus a `Trafero-<version>-changes.md` asset.
## Known caveats
- Staged verdict strings ('approve'/'reject') match web-client wording but were not exercised against a live server (read-only testing constraint).
- Flow editing, node/server restart, updater and disk-delete actions intentionally not exposed (agreed scope / safety).
## Architecture
Single :app module. data/api/TdarrClient (OkHttp, {data:{...}} envelope, TraferoApiException kinds: AUTH/NETWORK/SERVER/LEGACY), data/repo/TraferoRepo (typed parsing), DataStore server profiles, manual DI (AppContainer), Compose screens under ui/screens/*, pollLoop() helper for per-screen refresh.
## Reference
OpenAPI 2.0 spec of the target API vendored at app/src/main/assets/api-docs-v2.json (served live by any Tdarr server at /api/v2/public/api-docs/json).
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) — bug reports, feature requests and pull requests are all welcome. Keep server-mutating calls out of the codebase unless explicitly discussed.
## License
Trafero is licensed under the **GNU General Public License v3.0** — see [LICENSE](LICENSE) and [NOTICE](NOTICE). Trafero is an independent client for Tdarr and is not affiliated with or endorsed by the Tdarr project.