Add interactive ebook search & selection

Introduce interactive ebook support: adds two API endpoints to search (interactive-search-ebook) and create/select ebook requests (select-ebook), plus server-side handlers to route Anna's Archive (direct) and indexer (torrent/NZB) downloads. Frontend: extend RequestActionsDropdown and InteractiveTorrentSearchModal to support an "ebook" search mode and selection flow, and add hooks (useInteractiveSearchEbook / useSelectEbook). Settings: add ebook_auto_grab_enabled with UI toggle and enforce disabling when no ebook sources are enabled; settings GET/PUT updated to persist the flag (default = true to preserve behavior). Documentation updated (scheduler, ebook-sidecar, settings pages) and ranking algorithm docs/tests extended to cover ebook-related normalization and matching cases. Includes logging and ranking integration for indexer results and normalization for Anna's Archive handling.
This commit is contained in:
kikootwo
2026-02-02 19:59:58 -05:00
parent c913be5ca2
commit 1afab5d47f
19 changed files with 1339 additions and 115 deletions
+14 -1
View File
@@ -1,7 +1,7 @@
# Intelligent Ranking Algorithm
**Status:** ✅ Implemented | Comprehensive edge case test coverage
**Tests:** tests/utils/ranking-algorithm.test.ts (73 test cases)
**Tests:** tests/utils/ranking-algorithm.test.ts (80+ test cases)
Evaluates and scores torrents to automatically select best audiobook download.
@@ -19,6 +19,7 @@ Evaluates and scores torrents to automatically select best audiobook download.
-**Author presence check (10 tests)**
-**Context-aware filtering (3 tests)**
-**API compatibility (2 tests)**
-**CamelCase and punctuation separator handling (7 tests)**
**Tested edge cases prevent regressions from previous tweaks:**
- "We Are Legion (We Are Bob)" matching with/without subtitle
@@ -35,6 +36,18 @@ Evaluates and scores torrents to automatically select best audiobook download.
**1. Title/Author Match (60 pts max) - MOST IMPORTANT**
**Pre-Processing: Text Normalization**
- All titles and author names are normalized before matching
- **CamelCase splitting:** `"TheCorrespondent"``"the correspondent"`
- **Punctuation to spaces:** `"Twelve.Months-Jim"``"twelve months jim"`
- **Preserves apostrophes:** `"O'Brien"` remains `"o'brien"`
- Handles common indexer naming patterns (NZB, torrent scene releases)
**Examples of normalization:**
- `"VirginaEvans TheCorrespondent"``"virgina evans the correspondent"`
- `"Twelve.Months-Jim.Butcher"``"twelve months jim butcher"`
- `"Author_Name-Book.Title.2024"``"author name book title 2024"`
**Multi-Stage Matching:**
**Stage 1: Word Coverage Filter (MANDATORY)**