Skip to content

Config file, auto-cover default, transcribe auto-detect, download resilience#32

Merged
roelvangils merged 1 commit into
mainfrom
config-autocover-transcribe-autodetect
May 7, 2026
Merged

Config file, auto-cover default, transcribe auto-detect, download resilience#32
roelvangils merged 1 commit into
mainfrom
config-autocover-transcribe-autodetect

Conversation

@roelvangils
Copy link
Copy Markdown
Member

Summary

  • Persistent config file (~/.config/dpub/config.json) with dpub config subcommand. All convert/batch defaults settable once; CLI flags override.
  • --auto-cover on by default for both convert and batch. Opt out with --no-auto-cover.
  • --transcribe auto-detects language from dc:language metadata when no code is given. ISO 639-2 codes (e.g. dut) normalised to 639-1 (nl) for Whisper. Shared normaliser in dpub-util/lang.
  • Cover lookup runs in background thread, overlapping with transcription and audio recompression.
  • Download resilience: HTTP agent switched to per-read timeout (60s idle) instead of total-request timeout, and model downloads retry up to 3× on transient failures.

Test plan

  • cargo check clean
  • cargo test -p dpub-cli -p dpub-util -p dpub-meta -p dpub-convert — all 80 tests pass
  • Manual: dpub config shows example, dpub config --init creates file
  • Manual: dpub convert <book> -o out.epub picks up --auto-cover by default
  • Manual: dpub convert <book> -o out.epub --transcribe auto-detects nl from metadata
  • Manual: dpub convert <book> -o out.epub --transcribe nl still works as explicit override

🤖 Generated with Claude Code

… resilience

- Persistent JSON config file (~/.config/dpub/config.json) with `dpub config`
  subcommand. All convert/batch defaults can be set once; CLI flags override.
- --auto-cover now on by default for convert and batch (--no-auto-cover to opt out).
- --transcribe without a language code auto-detects from dc:language metadata,
  normalising ISO 639-2 (e.g. "dut") to 639-1 ("nl") for Whisper.
- Shared ISO 639 normaliser in dpub-util/lang, used by dpub-meta and dpub-cli.
- Cover lookup runs on a background thread, overlapping with transcription/recompression.
- HTTP agent switched from total-request timeout to per-read timeout (60 s idle)
  so multi-GB model downloads no longer time out while data is flowing.
- Model downloads retry up to 3 times on transient failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roelvangils roelvangils merged commit 5f784cd into main May 7, 2026
@roelvangils roelvangils deleted the config-autocover-transcribe-autodetect branch May 7, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant