Skip to content

Reject undersized releases in automatic search - #311

Closed
H0tChicken wants to merge 2 commits into
kikootwo:mainfrom
H0tChicken:fix/min-mb-per-minute
Closed

H0tChicken wants to merge 2 commits into
kikootwo:mainfrom
H0tChicken:fix/min-mb-per-minute

Conversation

@H0tChicken

@H0tChicken H0tChicken commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Automatic search only hard-filters results under 20 MB. Size vs. runtime is worth 15 of 100 base points, while title/author match is worth up to 60 and NZB results get the full 15 seeder points. So a single file from a multi-file Usenet post easily clears the 50-point threshold and gets auto-grabbed and imported as the whole book.

Real example (v1.2.3, watched-series auto-request): for The Prefect (1182 min runtime), the top pick was (A Reynolds Flood) [44/97] - "Alastair Reynolds - PDE 01 The Prefect - 44.mp3" at 57 MB (0.05 MB/min). It scored 79.7 and imported as a 20-minute book. The same happened for Redemption Ark and Absolution Gap in the same run.

Changes

  • rankTorrents gets an opt-in minMBPerMinute option. When the runtime is known, results below sizeMB / durationMinutes are filtered out alongside the existing 20 MB filter. With no runtime, nothing changes.
  • search-indexers.processor.ts (automatic search) passes 0.15 (~21 kbps). Across ~60 correct imports in my library, the lowest ratio was ~0.3 MB/min, and the bad single-file grabs were ~0.05. A reviewer reported a complete release at 0.21 MB/min (~29 kbps), so the floor sits below that.
  • Interactive search doesn't set it, so users can still see and pick anything (same pattern as requireAuthor).
  • Docs (phase3/ranking-algorithm.md) and 2 tests added.

Testing

  • npm test: 209 files / 2633 tests pass on Node 20 (matching CI).
  • next build succeeds with the Dockerfile's build env.

🤖 Generated with Claude Code

Automatic search only hard-filtered results under 20 MB. Size vs runtime is
worth 15/100 points while title match is ~60 and Usenet results get full
seeder points, so a single 57 MB chapter mp3 from a multi-file post scored
79.7 for a 20 h book (threshold 50) and was auto-grabbed and imported.

Add an opt-in minMBPerMinute option to rankTorrents and set it to 0.25
(~32 kbps) for automatic search when the Audible runtime is known.
Interactive search is unchanged so users can still pick anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Eyji

Eyji commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for this. Grabbing one chapter of a multi-file post as the whole book is a real problem, and a size floor is a cheap way to stop it.

However, I have a French release of Gagner la guerre (Jean-Philippe Jaworski) :

  • 443 MB for a 2154 minute Audible runtime, which is 0.21 MB/min, about 29 kbps :
  • The book is complete and Audiobookshelf reports 2155 minutes.

Problem is, with MIN_AUTO_MB_PER_MINUTE = 0.25, automatic search would drop it, and the request would stay in awaiting_search until someone picks the release by hand.

It's the lowest of the 20 releases I've imported (the others range from 0.45 to 1.01 MB/min). Your bad grabs were around 0.05 MB/min, so a lower floor would still catch those and let this one through.

A complete 443 MB / 2154 min release (0.21 MB/min, ~29 kbps) was
rejected by the 0.25 floor. 0.15 still rejects single-chapter grabs
(~0.05 MB/min). Add a regression test and move the constant below the
imports.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@H0tChicken

Copy link
Copy Markdown
Contributor Author

Thanks @Eyji, good catch. A complete 0.21 MB/min release is a legitimate case my sample (lowest ~0.3) didn't cover.

Pushed a fix: the automatic-search floor is now 0.15 MB/min (~21 kbps). That keeps your 443 MB / 2154 min release and still rejects the ~0.05 MB/min single-file grabs. Added a regression test using your numbers and updated the docs.

The scoring-baseline mismatch you found is tracked separately in #318 and is out of scope here.

@kikootwo

Copy link
Copy Markdown
Owner

First, credit where it's due @H0tChicken: this is a clean, focused fix for a nasty failure (a 20 minute "book" that looks complete). Thanks @Eyji too for the data that got the floor to 0.15.

I'm landing this on our branch with you as co-author, plus a small test that automatic search actually wires the floor in. Leaving this open until that lands.

kikootwo added a commit that referenced this pull request Oct 27, 2026
…#479)

Automatic search drops results under 0.15 MB per minute of runtime (about 21 kbps) when the runtime is known, next to the 20 MB filter, so one chapter file of a multi-file Usenet post is no longer grabbed as the whole book; interactive search still lists everything.
Replaces #311.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: H0tChicken <seanwilliams1375@gmail.com>
@kikootwo

Copy link
Copy Markdown
Owner

@H0tChicken this is out in v1.2.12, landed in #479 with you as co-author: https://github.com/kikootwo/ReadMeABook/releases/tag/v1.2.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants