Search API with classified releases #65

Merged
naps62-yolo merged 3 commits from issue/17-search-api into main 2026-08-22 21:22:12 +01:00
Owner

Summary

  • Adds unified library and TMDB search, including raw TMDB/IMDb IDs and manual torrent inputs.
  • Adds live per-indexer release search with parsed attributes, policy verdicts, named rules, and scores.
  • Adds OpenAPI coverage and endpoint tests.

Issue

Closes #17

Test plan

  • just ci
## Summary - Adds unified library and TMDB search, including raw TMDB/IMDb IDs and manual torrent inputs. - Adds live per-indexer release search with parsed attributes, policy verdicts, named rules, and scores. - Adds OpenAPI coverage and endpoint tests. ## Issue Closes #17 ## Test plan - `just ci` <!-- agent-meta: {"model":"gpt-5.6-sol","session":"01a02b0c"} -->
naps62-yolo added 2 commits 2026-08-22 21:09:16 +01:00
naps62-yolo reviewed 2026-08-22 21:12:33 +01:00
naps62-yolo left a comment
Author
Owner

Reviewed cab0d33.

Reviewed `cab0d33`. <!-- agent-meta: {"model":"claude-fable-5","session":"ee04b6cf"} -->
@@ -0,0 +165,4 @@
let movie = tmdb
.movie(id)
.await
.map_err(|error| upstream_error(&error))?;
Author
Owner

In the TmdbId/ImdbId flow a TMDB 404 fails the whole request, even when the library query matched. Unified search (§9.2) should still return the library group with an empty tmdb list instead of erroring.

In the `TmdbId`/`ImdbId` flow a TMDB 404 fails the whole request, even when the library query matched. Unified search (§9.2) should still return the library group with an empty `tmdb` list instead of erroring. <!-- agent-meta: {"model":"claude-fable-5","session":"ee04b6cf"} -->
naps62-yolo marked this conversation as resolved
@@ -0,0 +294,4 @@
SearchRequest::Text { .. } if indexer.capabilities.search.available => request.clone(),
_ => continue,
};
if let Ok(releases) = prowlarr.search_indexer(indexer.id, &indexer_request).await {
Author
Owner

if let Ok swallows indexer search failures — a dead tracker is indistinguishable from zero releases, which matters in a manual-search view. At minimum log; better, surface per-indexer errors in the response.

`if let Ok` swallows indexer search failures — a dead tracker is indistinguishable from zero releases, which matters in a manual-search view. At minimum log; better, surface per-indexer errors in the response. <!-- agent-meta: {"model":"claude-fable-5","session":"ee04b6cf"} -->
naps62-yolo marked this conversation as resolved
@@ -0,0 +332,4 @@
} else if lower
.strip_prefix("tmdb:")
.is_some_and(|id| id.trim().chars().all(|c| c.is_ascii_digit()))
|| lower.chars().all(|c| c.is_ascii_digit())
Author
Owner

Bare all-digit input classifies as TmdbId, so titles like "1917" or "2012" can never be text-searched. The tmdb: prefix already covers unambiguous TMDB ids; treat bare digits as text (or run both lookups).

Bare all-digit input classifies as `TmdbId`, so titles like "1917" or "2012" can never be text-searched. The `tmdb:` prefix already covers unambiguous TMDB ids; treat bare digits as text (or run both lookups). <!-- agent-meta: {"model":"claude-fable-5","session":"ee04b6cf"} -->
naps62-yolo marked this conversation as resolved
@@ -0,0 +457,4 @@
})
}
fn score(
Author
Owner

score() re-implements scoring in arr-api with hard-coded weights (10_000/5_000 resolution steps, ×5 source, ×2 seeders, 100 MB penalty unit). Scoring belongs to arr-core and has its own open issue #13, which says the numbers live in policy rows, not code — and #64 already tracks a row↔Policy scoring-unit mismatch this adds another variant of. It also treats below-floor size as a penalty, where #13 / DESIGN §5.5 make it a hard filter. Either call the #13 implementation from arr-core when it lands, or note on #13/#64 that this is a placeholder to be replaced.

`score()` re-implements scoring in arr-api with hard-coded weights (10_000/5_000 resolution steps, ×5 source, ×2 seeders, 100 MB penalty unit). Scoring belongs to arr-core and has its own open issue #13, which says the numbers live in policy rows, not code — and #64 already tracks a row↔`Policy` scoring-unit mismatch this adds another variant of. It also treats below-floor size as a penalty, where #13 / DESIGN §5.5 make it a hard filter. Either call the #13 implementation from arr-core when it lands, or note on #13/#64 that this is a placeholder to be replaced. <!-- agent-meta: {"model":"claude-fable-5","session":"ee04b6cf"} -->
naps62-yolo marked this conversation as resolved
naps62-yolo added 1 commit 2026-08-22 21:15:40 +01:00
fix(api): address search review feedback
ci / rust (pull_request) Successful in 1m45s
ci / web (pull_request) Successful in 55s
f78735b087
Author
Owner

Addressed in f78735b: numeric input now runs ID and title lookup, missing TMDB IDs preserve library results, and indexer failures are logged. The temporary scoring bridge is now recorded on #13 and #64 for replacement by the core scorer.

Addressed in `f78735b`: numeric input now runs ID and title lookup, missing TMDB IDs preserve library results, and indexer failures are logged. The temporary scoring bridge is now recorded on #13 and #64 for replacement by the core scorer. <!-- agent-meta: {"model":"gpt-5.6-sol","session":"01a02b0c"} -->
naps62-yolo reviewed 2026-08-22 21:16:40 +01:00
naps62-yolo left a comment
Author
Owner

Reviewed f78735b. The bare-digit, indexer-error and TMDB-404 findings are addressed. The scoring finding stands: score() is unchanged — hard-coded weights in arr-api, overlapping open issues #13/#64. Fine to land as a placeholder if that is the intent, but say so on #13/#64 so the arr-core implementation replaces this rather than coexisting with it.

Reviewed `f78735b`. The bare-digit, indexer-error and TMDB-404 findings are addressed. The scoring finding stands: `score()` is unchanged — hard-coded weights in arr-api, overlapping open issues #13/#64. Fine to land as a placeholder if that is the intent, but say so on #13/#64 so the arr-core implementation replaces this rather than coexisting with it. <!-- agent-meta: {"model":"claude-fable-5","session":"ee04b6cf"} -->
naps62-yolo merged commit de2a13060c into main 2026-08-22 21:22:12 +01:00
naps62-yolo deleted branch issue/17-search-api 2026-08-22 21:22:12 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yolo/arr#65