mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
5188fe1727
Previously, when a user changed the download_dir setting after initial setup, the qBittorrent category "readmeabook" would retain the old save path. This could cause torrents to download to the wrong location, depending on qBittorrent's Automatic Torrent Management (ATM) settings. Root cause: - ensureCategory() only created the category if it didn't exist - createCategory API is idempotent but doesn't update existing categories - If download_dir changed from /downloads to /downloads/RMAB, category would still have savePath=/downloads qBittorrent behavior: - If ATM enabled: category savePath overrides per-torrent savepath - If ATM disabled: per-torrent savepath takes precedence Fix: - ensureCategory() now calls both createCategory AND editCategory - createCategory: ensures category exists (idempotent) - editCategory: updates save path to match current download_dir config - This guarantees category path is always synced with database config Benefits: - Users can change download_dir setting and it takes effect immediately - Works regardless of ATM settings in qBittorrent - No manual qBittorrent category management needed Updated documentation/phase3/qbittorrent.md to explain category management and save path synchronization.
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