crabidy/plan/audiobookshelf-provider.md

2.4 KiB

Task plan — audiobookshelf provider

Ordered, verifiable tasks to build absdy per architecture/audiobookshelf-provider.md, satisfying quality/audiobookshelf-provider.md. All complete.

  • T1 — Crate skeleton. New workspace member absdy (Cargo.toml mirroring fyyd); add to root members and workspace.dependencies. Verify: cargo build -p absdy.
  • T2 — HTTP seam (api.rs). Abs trait (libraries/library_items/search_items/item_detail/stream_url), domain types (Library/Book/AudioTrack/BookDetail), typed FetchError, and AbsApi (bearer auth, per-call timeout, redacting Debug, defensive DTOs). Gates: G2, G3, G5, G6, G12.
  • T3 — Path model. AbsPath enum + total parse_path with the reserved-search split. Gate: G7. Tests: foreign_and_malformed_paths_are_rejected.
  • T4 — Settings + init. Settings (required base_url/api_key, bounds), redacting Debug, non-fatal init. Gates: G1, G14, G16. Tests: settings_*, init_requires_base_url_and_api_key.
  • T5 — Tree builders. get_lib_root placeholder + async get_lib_node (root→book libraries, library→search+books, book→tracks, search node/term), the shared book-listing/book-node builders, and the central download blessing. Gates: G8, G9, G10, G13. Tests: root_lists_*, a_library_lists_*, a_book_lists_*, an_audio_less_*.
  • T6 — Search-term store. Per-library in-memory terms; create/rename/delete idempotent + implicit recreation. Gate: G11. Tests: search_terms_*.
  • T7 — Playback. is_track_path, get_urls_for_track (URL built, no call), get_metadata_for_track (pick by ino). Gates: G12, G13. Tests: track_stream_url_*, track_metadata_*.
  • T8 — Orchestrator + settings wiring. abs_client field, abs_owns/abs_provider, build block, root child, all dispatch arms; ALL_PROVIDERS/ProviderToggles/all/provider_toggles. Gate: G15. Verify: cargo build -p crabidy-server, existing server tests pass.
  • T9 — Unit tests + gates. absdy/src/tests.rs (FakeApi seam), quality/audiobookshelf-provider.md. Verify: cargo test -p absdy.
  • T10 — Live validation. absdy/tests/live.rs (#[ignore]); ran against the test server. Gate: G17.
  • T11 — Docs. README /abs section (abs.toml, [audio]-style config). Verify: markdownlint.