Refactor indexer management and improve search logic

Refactors admin settings to use a new IndexersTab and card-based indexer management UI, supporting category selection and improved configuration. Updates backend and API routes to handle indexer categories, propagate ASIN for better search scoring, and group indexers by categories to optimize Prowlarr searches. Enhances documentation to clarify non-terminal request matching and auto-completion behavior. Adds new reusable components for indexer management and category selection.
This commit is contained in:
kikootwo
2026-01-13 21:32:54 -05:00
parent e346f88f42
commit 307b63fab4
30 changed files with 1787 additions and 671 deletions
+20 -2
View File
@@ -12,12 +12,18 @@ import { RMABLogger } from '../utils/logger';
const logger = RMABLogger.create('Prowlarr');
export interface SearchFilters {
category?: number;
category?: number; // Deprecated: use categories instead
categories?: number[]; // Array of category IDs to search
minSeeders?: number;
maxResults?: number;
indexerIds?: number[];
}
export interface IndexerCategory {
id: number;
name: string;
}
export interface Indexer {
id: number;
name: string;
@@ -26,6 +32,7 @@ export interface Indexer {
priority: number;
capabilities?: {
supportsRss?: boolean;
categories?: IndexerCategory[];
};
fields?: Array<{
name: string;
@@ -119,12 +126,23 @@ export class ProwlarrService {
const configService = getConfigService();
const clientType = (await configService.get('download_client_type')) || 'qbittorrent';
// Determine which categories to search
// Priority: filters.categories > filters.category > defaultCategory
let categoriesToSearch: number[];
if (filters?.categories && filters.categories.length > 0) {
categoriesToSearch = filters.categories;
} else if (filters?.category) {
categoriesToSearch = [filters.category];
} else {
categoriesToSearch = [this.defaultCategory];
}
const params: Record<string, any> = {
query,
type: 'search',
limit: 100, // Maximum results to return from Prowlarr
extended: 1, // Enable searching in tags, labels, and metadata
categories: filters?.category?.toString() || this.defaultCategory.toString(), // 3030 = Audiobooks (standard Newznab category)
categories: categoriesToSearch, // Will be serialized as categories=3030&categories=3040 etc
};
// Filter by specific indexers if provided