Skip to content

separate Prowlarr audiobook results from ABB#51

Open
sgerner wants to merge 2 commits into
JeremiahM37:mainfrom
sgerner:codex/prowlarr-audiobook-source-label
Open

separate Prowlarr audiobook results from ABB#51
sgerner wants to merge 2 commits into
JeremiahM37:mainfrom
sgerner:codex/prowlarr-audiobook-source-label

Conversation

@sgerner
Copy link
Copy Markdown

@sgerner sgerner commented May 31, 2026

What changed

  • Prowlarr audiobook search results now use the distinct source label prowlarr_audiobooks instead of audiobook.
  • Updated the corresponding unit test to assert the new label.

Why

Librarr already treats audiobook as the ABB source. That causes Prowlarr audiobook NZB results to be filtered as if they were ABB rows, which drops them when they do not have ABB-specific metadata or seeders.

Impact

  • Prowlarr audiobook results from indexers such as nzb.life now survive librarr's filter path.
  • ABB search behavior is unchanged.
  • The change is scoped to librarr result labeling only; no Prowlarr configuration changes are required.

Validation

  • go test ./internal/search -run 'TestProwlarr|TestIsNZBURL'
  • Built a temporary image from the patched source and ran a smoke test against GET /api/search/audiobooks?q=The Martian.
  • Confirmed the returned results include source: "prowlarr_audiobooks" and indexer: "Nzb.life".

@sgerner sgerner changed the title [codex] separate Prowlarr audiobook results from ABB separate Prowlarr audiobook results from ABB May 31, 2026
@sgerner sgerner marked this pull request as ready for review May 31, 2026 23:32
@JeremiahM37 JeremiahM37 self-assigned this Jun 1, 2026
@JeremiahM37 JeremiahM37 dismissed their stale review June 1, 2026 02:38

Retracting — I was wrong. GetSource catches prowlarr_audiobooks via Prowlarr's Name() so the download.go and requests.go literal checks are unreachable for this label. filter.go:155 is a flat-2 priority instead of 1-if-seeded but that only matters for seeded results, not NZBs (this PR's actual target).

JeremiahM37
JeremiahM37 approved these changes Jun 1, 2026
Copy link
Copy Markdown
Owner

@JeremiahM37 JeremiahM37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more spot to update: internal/search/scorer.go:267 — add "prowlarr_audiobooks" to the audiobook case in guessMediaType, otherwise size scoring falls through to the ebook range and a typical audiobook NZB drops from 10 to 3.

source := "torrent"
if p.tab == "audiobook" {
source = "audiobook"
source = "prowlarr_audiobooks"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: internal/search/scorer.go:267 (guessMediaType) still only maps Source=="audiobook" to the audiobook size band. Prowlarr doesn't set MediaType on its results, so prowlarr_audiobooks now falls through to ebook here and a 500MB-2GB audiobook NZB drops from a size score of 10 to 3. Add "prowlarr_audiobooks" to that case too.

@JeremiahM37 JeremiahM37 assigned sgerner and unassigned JeremiahM37 and sgerner Jun 1, 2026
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