mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 21:00:09 +00:00
a59bbedd00
**Problem:** Prowlarr searches were querying ALL indexers instead of only the ones enabled in user settings, causing torrents to be selected from disabled/untrusted indexers. **Root Cause:** The prowlarr.search() method didn't filter by indexer IDs, and callers weren't passing enabled indexer IDs to the search. **Changes:** 1. Added indexerIds parameter to SearchFilters interface 2. Updated prowlarr.service.ts search() to filter by indexerIds 3. Updated search-indexers.processor.ts to fetch and pass enabled indexer IDs 4. Updated interactive-search route to fetch and pass enabled indexer IDs 5. Added validation: search fails if no indexers are configured/enabled 6. Updated documentation to reflect indexer filtering behavior **Impact:** - Manual search: Only searches enabled indexers - Interactive search: Only searches enabled indexers - RSS monitoring: Already correctly filtered (no changes needed) **Testing:** TypeScript type checking passed with no errors
96 lines
3.1 KiB
Markdown
96 lines
3.1 KiB
Markdown
# Prowlarr Integration
|
|
|
|
**Status:** ✅ Implemented | Manual search, interactive search, automatic search
|
|
|
|
Indexer aggregator for searching multiple torrent/usenet indexers simultaneously. Supports manual search, interactive torrent selection, and automatic RSS feed monitoring.
|
|
|
|
## API
|
|
|
|
**Base:** `http://prowlarr:9696/api/v1`
|
|
**Auth:** `X-Api-Key` header
|
|
|
|
**GET /search?query={q}&categories=3030&indexerIds={ids}** - Search indexers (3030 = audiobooks, ids = comma-separated indexer IDs)
|
|
**GET /indexer** - List configured indexers
|
|
**GET /indexerstats** - Indexer statistics
|
|
**GET /feed/{indexerId}/api?t=search&cat=3030&limit=100** - RSS feed for specific indexer
|
|
|
|
## Search
|
|
|
|
**Extended Search:** Enabled (`extended=1`) - searches title, tags, labels, and metadata fields
|
|
|
|
```typescript
|
|
interface TorrentResult {
|
|
indexer: string;
|
|
title: string;
|
|
size: number; // bytes
|
|
seeders: number;
|
|
leechers: number;
|
|
publishDate: Date;
|
|
downloadUrl: string; // magnet or .torrent
|
|
infoHash?: string;
|
|
guid: string;
|
|
format?: 'M4B' | 'M4A' | 'MP3';
|
|
bitrate?: string;
|
|
hasChapters?: boolean;
|
|
}
|
|
```
|
|
|
|
## Config
|
|
|
|
- `indexer.prowlarr_url`
|
|
- `indexer.prowlarr_api_key`
|
|
|
|
## Error Handling
|
|
|
|
- 401: Invalid API key
|
|
- 429: Rate limit (exponential backoff, max 3 retries)
|
|
- 503: Service unavailable
|
|
- Timeout: 30s per search
|
|
|
|
## Manual & Interactive Search
|
|
|
|
**Indexer Filtering:** All searches (manual and interactive) only query indexers enabled in settings (`prowlarr_indexers` config). If no indexers are enabled, search will fail with error.
|
|
|
|
**Manual Search** (`POST /api/requests/{id}/manual-search`)
|
|
- Triggers automatic search job for requests with status: pending, failed, awaiting_search
|
|
- Searches only enabled indexers
|
|
- Uses ranking algorithm to select best torrent
|
|
- Updates request status to 'pending'
|
|
|
|
**Interactive Search** (`POST /api/requests/{id}/interactive-search`)
|
|
- Returns ranked torrent results for user selection
|
|
- Searches only enabled indexers
|
|
- Shows table with: rank, title, size, quality score, seeders, indexer, publish date
|
|
- Available for same statuses as manual search
|
|
- User clicks "Download" button to select specific torrent
|
|
|
|
**Select Torrent** (`POST /api/requests/{id}/select-torrent`)
|
|
- Downloads user-selected torrent from interactive search
|
|
- Triggers download_torrent job
|
|
- Updates request status to 'downloading'
|
|
|
|
**UI Integration:**
|
|
- Manual Search button: Triggers automatic search
|
|
- Interactive Search button: Opens modal with torrent results
|
|
- Both buttons shown for requests with status: pending, failed, awaiting_search
|
|
|
|
## RSS Monitoring
|
|
|
|
**Automatic Feed Monitoring:** Enabled per-indexer via setup wizard or settings page
|
|
**Schedule:** Every 15 minutes (default, configurable)
|
|
**Process:**
|
|
1. Fetch RSS feeds from all indexers with RSS enabled
|
|
2. Fuzzy match results against requests in 'awaiting_search' status
|
|
3. Trigger search jobs for matches
|
|
4. Limit: 100 results per feed, 100 missing requests per check
|
|
|
|
**Matching Logic:**
|
|
- Author name must appear in torrent title
|
|
- At least 2 title words (>2 chars) must match
|
|
- First match triggers search job (no duplicates)
|
|
|
|
## Tech Stack
|
|
|
|
- axios
|
|
- bottleneck (rate limiting)
|