Slice 5: Accompanying files + output structure #7

Closed
opened 2026-06-03 10:27:39 +02:00 by AlexKucera · 0 comments
AlexKucera commented 2026-06-03 10:27:39 +02:00 (Migrated from github.com)

Parent

#1

What to build

PDF extras and cover art download, completing the output structure rules.

client module (accompanying file endpoints):

  • GET /api/v10/library/{isbn}/pdf_extra_url?filename={name} — PDF extra download URL
  • Cover art URL already available from book details (fetched in Slice 2) — no new endpoint needed

downloader module (accompanying files):

  • Download PDF extras when present and download.download_extras is true
  • Download cover art when present and download.download_covers is true
  • Both downloaded into the book's output location (subdirectory if audio is in subdirectory, same level otherwise)
  • Use same streaming .partial → atomic rename pattern as audio downloads
  • These are non-critical: failure to download an accompanying file logs a warning but does not cause the book to be marked as failed

Output structure verification:

  • Book with accompanying files → subdirectory with audio + pdf + cover inside
  • Book without accompanying files → audio file as leaf node
  • This should now work correctly end-to-end since subdirectory decision (Slice 3a) and accompanying file presence drive the layout

Acceptance criteria

  • PDF extras downloaded when available and config enabled
  • Cover art downloaded when available and config enabled
  • PDF/cover failures logged as warnings (not book-level errors)
  • Accompanying files placed in correct location (inside subdirectory or alongside audio)
  • Book with extras creates subdirectory with audio + extras inside
  • Book without extras outputs audio as leaf file
  • download_extras: false skips PDF download even when available
  • download_covers: false skips cover download even when available
  • ~10 tests: PDF download triggering, cover download triggering, directory layout with/without extras, config toggle behavior
  • All tests pass

Blocked by

#6

## Parent #1 ## What to build PDF extras and cover art download, completing the output structure rules. **client module (accompanying file endpoints):** - `GET /api/v10/library/{isbn}/pdf_extra_url?filename={name}` — PDF extra download URL - Cover art URL already available from book details (fetched in Slice 2) — no new endpoint needed **downloader module (accompanying files):** - Download PDF extras when present and `download.download_extras` is true - Download cover art when present and `download.download_covers` is true - Both downloaded into the book's output location (subdirectory if audio is in subdirectory, same level otherwise) - Use same streaming .partial → atomic rename pattern as audio downloads - These are non-critical: failure to download an accompanying file logs a warning but does not cause the book to be marked as failed **Output structure verification:** - Book with accompanying files → subdirectory with audio + pdf + cover inside - Book without accompanying files → audio file as leaf node - This should now work correctly end-to-end since subdirectory decision (Slice 3a) and accompanying file presence drive the layout ## Acceptance criteria - [ ] PDF extras downloaded when available and config enabled - [ ] Cover art downloaded when available and config enabled - [ ] PDF/cover failures logged as warnings (not book-level errors) - [ ] Accompanying files placed in correct location (inside subdirectory or alongside audio) - [ ] Book with extras creates subdirectory with audio + extras inside - [ ] Book without extras outputs audio as leaf file - [ ] `download_extras: false` skips PDF download even when available - [ ] `download_covers: false` skips cover download even when available - [ ] ~10 tests: PDF download triggering, cover download triggering, directory layout with/without extras, config toggle behavior - [ ] All tests pass ## Blocked by #6
Sign in to join this conversation.