Files
ReadMeABook/documentation/phase3
Claude ef98dcf438 Fix file copy location to respect configured media directory
Previously, files were always being copied to /media/audiobooks regardless
of the configured media directory in settings. This was caused by:

1. FileOrganizer singleton reading from MEDIA_DIR env var (never set)
   instead of database config 'media_dir'
2. Hardcoded /media/audiobooks fallback being used when env var not found
3. Three locations passing hardcoded paths to addOrganizeJob (unused)

Changes:
- Modified getFileOrganizer() to read media_dir from database config
- Made targetPath parameter optional in addOrganizeJob (not used by processor)
- Removed hardcoded /media/audiobooks paths from all addOrganizeJob calls
- Updated organize-files processor to await getFileOrganizer()
- Updated documentation to reflect configuration behavior

Files now correctly copy to the directory configured in setup wizard or
settings page, with /media/audiobooks only as fallback if not configured.

Fixes: User-reported issue where configured media directory was ignored
2026-01-28 11:41:56 -05:00
..
2026-01-28 11:41:24 -05:00
2026-01-28 11:41:24 -05:00
2026-01-28 11:41:24 -05:00

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

  1. search_indexers - Search Prowlarr for torrents
  2. rank_results - Apply ranking algorithm, select best
  3. download_torrent - Add to qBittorrent
  4. monitor_download - Poll progress (10s intervals)
  5. process_audiobook - Organize files to media directory
  6. 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