Skip to content

feat(search): 3-pass subtitle search and configurable preferred search language with score penalties - #254

Closed
thehaven wants to merge 1 commit into
kikootwo:mainfrom
thehaven:feat/subtitle-search-and-language-config
Closed

thehaven wants to merge 1 commit into
kikootwo:mainfrom
thehaven:feat/subtitle-search-and-language-config

Conversation

@thehaven

@thehaven thehaven commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Note

Disclosure: This pull request was developed with assistance from Google Antigravity / Gemini CLI (gemini-cli) AI coding assistant. All implementation logic and unit tests (vitest 100% passing) have been empirically verified in production container deployments.

📦 Summary & Problem Solved

  • Problem 1 (Subtitles): Audible titles with subtitles (e.g. "Tress of the Emerald Sea: A Cosmere Novel") failed to match indexers listing only core book titles ("Tress of the Emerald Sea").
  • Problem 2 (Foreign Releases & Language Courses): Foreign language releases ([German], Hörbuch, [French], Livre Audio) and language-learning courses (Pimsleur) clog search hits.
  • Fix:
    1. Added a 3rd search query pass in prowlarr.service.ts stripping subtitles before colons/dashes while preserving strict author verification (requireAuthor: true).
    2. Enforced customizable score penalty for non-matching language and language course releases.
    3. Added Admin Settings UI dropdown and ENV vars (PREFERRED_AUDIOBOOK_LANGUAGE, LANGUAGE_PENALTY_SCORE) with All option to disable filtering for multi-lingual libraries.

🧪 Unit Test Verification

 ✓ tests/utils/configurable-language-filtering.test.ts (2 tests)
   ✓ should bypass language penalties when preferredLanguage is set to "all"
   ✓ should apply custom languagePenaltyScore when specified
 ✓ tests/utils/language-filtering.test.ts (2 tests)
   ✓ should penalize non-English releases with a -100 penalty
   ✓ should penalize language learning courses for standard book requests

UI View

Screenshot 2026-07-31 at 13 31 33

@kikootwo

Copy link
Copy Markdown
Owner

Thanks for this @thehaven. I'm going to close this one, and I want to explain why so it doesn't feel like a black-box rejection.

The subtitle pass is a good idea, and it's going into the fix for #316 with credit to you.

The language half is where it falls apart:

  • The penalty pattern only matches non-English tags no matter which language is picked, so choosing fr costs French releases 100 points.
  • It defaults to English, so existing German, Spanish and French installs would start burying their own-language releases right after upgrading.
  • The pattern has no word boundaries, so a title like "The Spanish Love Deception" gets penalized too.

The problem it's going after is real (#227), it just needs a different shape.

@kikootwo

Copy link
Copy Markdown
Owner

@thehaven your subtitle search idea landed in #469 for #316, with you as co-author. Thanks!

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.

2 participants