mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
Implement user soft-delete and improve search ranking
Adds soft-delete support for local users, including backend, API, and UI changes to allow admins to delete local users while preserving their requests. Updates user queries to exclude deleted users and allows username reuse for deleted accounts. Refines search and ranking logic for torrents: uses title-only queries for broader results, increases max results to 100, applies a minimum score threshold (30/100), and logs detailed ranking breakdowns. Updates the ranking algorithm to prioritize title/author match, adjusts scoring weights, and improves BookDate compatibility with Audiobookshelf by disabling rating-based features when unsupported. Enhances file copy operations for large files, improves metadata tagging, and updates documentation to reflect new search and ranking strategies.
This commit is contained in:
@@ -14,10 +14,22 @@ Indexer aggregator for searching multiple torrent/usenet indexers simultaneously
|
||||
**GET /indexerstats** - Indexer statistics
|
||||
**GET /feed/{indexerId}/api?t=search&cat=3030&limit=100** - RSS feed for specific indexer
|
||||
|
||||
## Search
|
||||
## Search Strategy
|
||||
|
||||
**Search Query:** Title only (not title + author)
|
||||
- Broader search yields more results (e.g., 20 vs 1)
|
||||
- Ranking algorithm filters out mismatches using author/narrator
|
||||
- Works around indexer limitations with complex queries
|
||||
|
||||
**Extended Search:** Enabled (`extended=1`) - searches title, tags, labels, and metadata fields
|
||||
|
||||
**Result Filtering:**
|
||||
- Minimum score threshold: 30/100
|
||||
- Filters applied after ranking to remove poor matches
|
||||
- maxResults: 100 (increased from 50 for broader search)
|
||||
|
||||
**Example:** "Season of Storms" → finds all "Season of Storms" torrents → ranks by author match → filters score < 30
|
||||
|
||||
```typescript
|
||||
interface TorrentResult {
|
||||
indexer: string;
|
||||
@@ -53,13 +65,15 @@ interface TorrentResult {
|
||||
|
||||
**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
|
||||
- Searches only enabled indexers (title only, maxResults: 100)
|
||||
- Ranks all results, filters scores < 30
|
||||
- Selects best torrent from filtered results
|
||||
- Updates request status to 'pending'
|
||||
|
||||
**Interactive Search** (`POST /api/requests/{id}/interactive-search`)
|
||||
- Returns ranked torrent results for user selection
|
||||
- Searches only enabled indexers
|
||||
- Searches only enabled indexers (title only, maxResults: 100)
|
||||
- Ranks all results, filters scores < 30
|
||||
- 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
|
||||
|
||||
@@ -1,29 +1,38 @@
|
||||
# Intelligent Ranking Algorithm
|
||||
|
||||
**Status:** ❌ Not Implemented
|
||||
**Status:** ✅ Implemented
|
||||
|
||||
Evaluates and scores torrents to automatically select best audiobook download.
|
||||
|
||||
## Scoring Criteria (100 points max)
|
||||
|
||||
**1. Format Quality (40 pts max)**
|
||||
- M4B with chapters: 40
|
||||
- M4B without chapters: 35
|
||||
- M4A: 25
|
||||
- MP3: 15
|
||||
- Other: 5
|
||||
**1. Title/Author Match (50 pts max) - MOST IMPORTANT**
|
||||
- Title matching: 0-35 pts
|
||||
- Exact substring match → 35 pts
|
||||
- No exact match → fuzzy similarity (partial credit)
|
||||
- Author presence: 0-15 pts
|
||||
- Splits authors on delimiters (comma, &, "and", " - ")
|
||||
- Filters out roles ("translator", "narrator")
|
||||
- Proportional credit for partial matches
|
||||
- Order-independent, no structure assumptions
|
||||
- Ensures correct book is selected over wrong book with better format
|
||||
|
||||
**2. Seeder Count (25 pts max)**
|
||||
- Formula: `Math.min(25, Math.log10(seeders + 1) * 10)`
|
||||
- 1 seeder: 0pts, 10 seeders: 10pts, 100 seeders: 20pts, 1000+: 25pts
|
||||
**2. Format Quality (25 pts max)**
|
||||
- M4B with chapters: 25
|
||||
- M4B without chapters: 22
|
||||
- M4A: 16
|
||||
- MP3: 10
|
||||
- Other: 3
|
||||
|
||||
**3. Size Reasonableness (20 pts max)**
|
||||
**3. Seeder Count (15 pts max)**
|
||||
- Formula: `Math.min(15, Math.log10(seeders + 1) * 6)`
|
||||
- 1 seeder: 0pts, 10 seeders: 6pts, 100 seeders: 12pts, 1000+: 15pts
|
||||
|
||||
**4. Size Reasonableness (10 pts max)**
|
||||
- Expected: 1-2 MB/min (64-128 kbps)
|
||||
- Deviation from expected → penalty
|
||||
|
||||
**4. Title Match Quality (15 pts max)**
|
||||
- Fuzzy match: title + author (Levenshtein distance)
|
||||
- Narrator bonus
|
||||
- Perfect match: 10 pts
|
||||
- Deviation → penalty
|
||||
- Unknown duration: 5 pts (neutral)
|
||||
|
||||
## Interface
|
||||
|
||||
|
||||
Reference in New Issue
Block a user