When a grabbed release fails (transfer error / peer-cancel / never lands), the engine now retries instead of giving up — the music-style depth: - Grab stores the OTHER accepted results as a retry pool + the search context (schema v16: candidates / search_ctx / tried_queries / tried_files / attempts). - core/video/retry.py (pure, tested): plan_retry() → try the next-best candidate; when the pool is dry, next_query() generates an ALTERNATE query (movie: drop the year; TV: numbering variants) to re-search; budget MAX_ATTEMPTS=6. merge_candidates dedupes against already-tried releases. - Monitor: on failure, _fail_or_retry hops to the next candidate inline; if none, flips the row to a new 'searching' state and a background requery thread re-searches the alternate query, evaluates against the profile, and starts the best fresh hit — or marks failed once truly exhausted. 'searching' rows are owned by their thread. - Page: 'Searching' status (Trying another release…) + a 'Nx' attempt badge. 16 tests (retry engine + candidate-retry transition); ruff clean on touched files. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| music_database.py | ||
| personalized_schema.py | ||
| video_database.py | ||
| video_schema.sql | ||