Targeted-search backoff and release-date gating #90
Merged
naps62-yolo
merged 2 commits from 2026-08-23 00:42:13 +01:00
issue/26-search-backoff into main
Labels
Clear labels
area/api
area/ci
area/compat
area/core
area/daemon
area/db
area/dl
area/indexer
area/infra
area/meta
area/parse
area/probe
area/subs
area/web
difficulty/easy
difficulty/hard
difficulty/moderate
difficulty/trivial
phase/1-skeleton
phase/2-logic
phase/3-sourcing
phase/4-movies
phase/5-ui
phase/6-tv
phase/7-people
phase/8-compat
phase/9-subtitles
type/bug
type/chore
type/feature
type/test
arr-api
CI and test harness
arr-compat
arr-core
arr-daemon
arr-db
arr-dl
arr-indexer
workspace and tooling
arr-meta
arr-parse
arr-probe
arr-subs crate: providers, extraction, translation, sync
web/
bounded, obvious approach, few files
subtle correctness or cross-cutting
multiple files, judgement, an interface to design
one file, mechanical, no design decisions
workspace, CI, config, database, empty API and SPA
parsing and policy engine, pure, no network
TMDB and Prowlarr, read-only
movies end to end
search, buckets, library views, queues
seasons, episodes, tracking, derived status
owner tags and notifications
Jellyseerr shim
build order: subtitles, DESIGN.md §15
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yolo/arr#90
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds TMDB-gated targeted search, the 1h/6h/1d/3d/7d backoff, and reset-on-metadata-change behavior.
Closes #26.
Reviewed
1d5501449d162d7838f58543a42ddcacb2788c80.@@ -143,3 +153,2 @@}for movie in gaps {let Some(movie) = self.refresh_metadata(database, movie).await? else {refresh_metadata(...).await?propagates a TMDB error out oftick: one failed TMDB request aborts the whole pass — remaining pending movies are skipped and the outcomes fromtrack_sent_grabsare dropped.grab_onefailures are deliberately per-movie ("One title's failure must not cost the rest of the tick"); TMDB failures deserve the same log-and-continue treatment.@@ -162,0 +188,4 @@};let tmdb_id =u32::try_from(movie.tmdb_id).map_err(|_| GrabError::InvalidTmdbId(movie.id))?;let metadata = tmdb.movie(tmdb_id).await?;TMDB is queried once per pending movie on every 30 s tick, before the
search_duegate. A wanted list of N unreleased or backed-off movies costs 2N TMDB requests per minute forever; the §6.2 cost table says targeted work is one call per wanted item per attempt. A per-movie refresh TTL (hours) would keep the metadata-change reset without the per-tick fetch.@@ -354,6 +441,7 @@ impl GrabAction {let Some(winner) = candidates.into_iter().find(|candidate| {!blacklist.blocks_candidate(&candidate.name, &candidate.download_url)}) else {record_search(database, movie.id).await?;record_searchnow runs only in the no-eligible-winner branch. When a winner exists but the grab fails after the search — a Transmission error (Errfromgrab_one), or the blacklisted-infohash drop path returningOk(None)— the attempt is not recorded, so the same full Torznab search (and in the blacklist case, an add + drop of the same torrent) repeats every 30 s with no backoff. Record the search before winner selection, or in those failure paths too.Reviewed
425a0466161c3c721c50de5a04ee73f183b91a7e. All three prior findings addressed (per-movie TMDB error handling, 6 h metadata refresh TTL,record_searchon failed-grab paths). No findings.Addressed all three findings, see inline replies.
@@ -143,3 +153,2 @@}for movie in gaps {let (movie_id, title) = (movie.id, movie.title.clone());Fixed:
refresh_metadataerrors now log andcontinueintick, same asgrab_onefailures — one title's metadata error no longer aborts the rest of the pass. Pushed in425a046.@@ -161,1 +188,4 @@async fn refresh_metadata(&self,database: &Db,Fixed: added a persisted
metadata_refreshed_atcolumn (migration 0009) with a 6h TTL, independent of the search backoff. When not due, the storeddigital_releasegates the search instead of hitting TMDB. Covered by a new test that uses a freshTmdbClientper tick to rule out its own response cache masking the effect. Pushed in425a046.@@ -440,5 +440,5 @@.await?;let Some(winner) = candidates.into_iter().find(|candidate| {!blacklist.blocks_candidate(&candidate.name, &candidate.download_url)}) else {record_search(database, movie.id).await?;Fixed:
record_searchnow also runs on the Transmission-error path and the blacklisted-infohash drop path (extracted intosend_winner), not only when no winner is found. Pushed in425a046.