mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-02 20:30:10 +00:00
9dd09ec836
Refactor ebook flow to support multiple sources (Anna's Archive direct downloads + Prowlarr indexer search) and unify handling with existing audiobook processors. Key changes: - search-ebook.processor: rewritten to try Anna's Archive first then fall back to indexer search, add Prowlarr grouping, ranking (rankEbookTorrents), and handlers to route results to direct-download or download-torrent flows. - organize-files.processor: enriches audiobook/ebook metadata from AudibleCache (year, narrator), treats indexer downloads specially (seed retention), adds optional NZB cleanup/archive logic, and improves retryable error detection. - file-organizer: organizeEbook now accepts additional metadata and an isIndexerDownload flag and supports directories vs single-file paths. - API/UI: include request.type in admin requests API and remove the “coming soon” notice from Ebook settings tab. - fetch-ebook route: removed blocking error for indexer-only mode so the flow can proceed when indexer search is enabled. - Documentation: update TOC, ebook-sidecar, settings-pages, and ranking-algorithm docs to describe indexer search, unified ebook ranking, configuration, and flows. These changes enable indexer-based ebook discovery, ranking, and downloads while preserving existing Anna's Archive behavior and reusing audiobook download processors where possible.
Phase 3: Automation Engine
Status: ⏳ In Development
Multi-stage pipeline transforming requests into downloaded, organized media in Plex.
Pipeline
Request → search_indexers → rank_results → download_torrent
→ monitor_download → process_audiobook → update_plex
Job Types
- search_indexers - Search Prowlarr for torrents
- rank_results - Apply ranking algorithm, select best
- download_torrent - Add to qBittorrent
- monitor_download - Poll progress (10s intervals)
- process_audiobook - Organize files to media directory
- update_plex - Trigger scan, fuzzy match
Integration Points
Indexers: Prowlarr (primary), Jackett (fallback) Download Clients: qBittorrent (primary), Transmission (fallback) Media Server: Plex (scan + match)
Job Queue (Bull)
- Redis-backed for persistence
- Retry: 3 attempts, exponential backoff (2s, 4s, 8s)
- Priorities: High (10), Medium (5), Low (1)
- Concurrency: 3 concurrent per type
- Jobs survive app restarts
Config Keys
Prowlarr: indexer.type=prowlarr, indexer.prowlarr_url, indexer.prowlarr_api_key
qBittorrent: download_client.type=qbittorrent, download_client.qbittorrent_url/username/password
Paths: paths.download_dir, paths.media_dir