mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-02 20:30:10 +00:00
f23afc1ba2
Implement Plex-compatible file-extension coercion to avoid Plex silently ignoring .mp4 (and single-file .m4a) audiobooks (issue #166). Adds a DB migration and configuration key (plex_format_coercion_enabled, default true), exposes a toggle in the setup wizard and Admin Paths settings, and persists/reads the setting in the admin/setup APIs. Introduces src/lib/utils/format-coercion.ts (coerceToPlexCompatible) and related constants in src/lib/constants/audio-formats.ts (PLEX_COMPATIBLE_EXTENSIONS, COERCION_RENAME_MAP, DRM_EXTENSIONS, TRANSCODE_REQUIRED_EXTENSIONS). The organize-files processor now runs coercion after organizing/tagging and before generating the filesHash and triggering scans; coercion is idempotent, never overwrites existing targets, logs warnings on DRM/transcode/permission errors, and is non-fatal. Adds unit tests for the coercion util and updates processor & setup UI tests. Updates documentation (TABLEOFCONTENTS, file-organization, fixes/file-hash-matching, settings-pages) describing behavior, config, and constraints.
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 download client (qBittorrent/Transmission/SABnzbd)
- 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 or Transmission (torrent), SABnzbd (usenet) — details 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
Related Docs
- Prowlarr
- Download Clients - Multi-client management, protocol routing
- qBittorrent
- SABnzbd
- Ranking Algorithm
- File Organization
- Plex Integration