Skip to content

Harden wanted-search language behavior for normalization work#3384

Open
mjc wants to merge 14 commits into
morpheus65535:developmentfrom
mjc:mjc/wanted-search-wanted-adaptive
Open

Harden wanted-search language behavior for normalization work#3384
mjc wants to merge 14 commits into
morpheus65535:developmentfrom
mjc:mjc/wanted-search-wanted-adaptive

Conversation

@mjc

@mjc mjc commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR hardens wanted-search and adaptive-search language handling before the wanted-search storage model changes in the performance work.

It keeps the current serialized wanted-state model in place, but makes the existing movie and episode wanted-search paths stricter and more predictable around malformed language tokens, forced/HI flags, audio-language fallbacks, and failed-attempt updates.

What changed

  • Rejects malformed wanted-language tokens instead of carrying unknown flags into provider searches.
  • Normalizes forced/HI language flags consistently across wanted movie, wanted episode, and adaptive-search paths.
  • Handles mixed-case flags, multi-colon input, empty base-language tokens, and legacy wanted rows predictably.
  • Handles malformed or missing audio-language rows without crashing wanted-search planning.
  • Keeps failed-attempt updates chained correctly across multiple requested languages.
  • Preserves missing scene names as None through wanted-search payload construction.
  • Moves wanted/adaptive edge-case coverage onto the shared database-backed fixture layer from PR Prepare wanted-search tests and CI for normalization work #3383.

Why this is separate

The normalized wanted-state PR relies on these language and retry semantics being pinned down first. Keeping this as a hardening PR lets the later storage/query changes focus on performance and schema shape instead of mixing in behavior fixes for malformed wanted-language data.

Tests

The added and updated tests cover malformed wanted-language tokens, forced/HI normalization, duplicate and mixed-case flags, multi-language retry updates, audio-language fallback behavior, missing scene names, scheduled wanted-search filtering, provider wrapper behavior, and adaptive-search property cases. The tests use the shared transactional fixtures and mock only provider/search side effects.

mjc added 4 commits June 10, 2026 12:42
Align requests floor with vendored runtime
Add shared wanted-search fixture layer

Cover wanted-search fixtures with focused tests
(cherry picked from commit faa01ff)

test: add mass-download fixture support

test: complete mass-download fixture support

test: add shared wanted database binder

test: simplify wanted kind inference

test: register wanted fixtures at top level

test: drop unused transactional tmp fixture

test: bind profile lookup to wanted test database

test: bind profile list lookup to wanted fixtures
@mjc

mjc commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Note on the diff shape: this PR is intentionally opened against development as a draft so it can be reviewed before PR #3383 merges. It builds directly on #3383, so GitHub currently shows the combined/flattened diff. Once #3383 lands, I'll rebase this branch onto the updated development branch and the diff should collapse down to just the wanted/adaptive language hardening changes from this PR.

@mjc mjc force-pushed the mjc/wanted-search-wanted-adaptive branch from 73e1566 to 005c8d2 Compare June 11, 2026 19:17
@mjc mjc force-pushed the mjc/wanted-search-wanted-adaptive branch from 005c8d2 to 26143d3 Compare June 12, 2026 06:25
@mjc mjc force-pushed the mjc/wanted-search-wanted-adaptive branch from 26143d3 to 6fe3af1 Compare June 14, 2026 17:31
@mjc mjc force-pushed the mjc/wanted-search-wanted-adaptive branch from 6fe3af1 to 4b3dd62 Compare June 15, 2026 19:39
@mjc

mjc commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

I rebased this branch on the updated shared wanted-search fixture layer from #3383 and kept the wanted/adaptive behavior coverage here.

This branch owns the follow-up behavior tests for:

  • malformed or invalid missing_subtitles values failing safe
  • language token normalization, deduping, casing, whitespace, and multi-flag parsing
  • adaptive retry filtering and failed-attempt stamping order
  • malformed audio profile rows resolving to no audio language instead of crashing
  • missing media paths skipping generate_subtitles
  • non-integer/unknown series season/episode values in scheduled-search progress messages
  • scheduled-search empty/throttled/completed paths and provider refresh between items

I also adjusted these tests to use local worker helpers instead of reintroducing the shared wanted_worker fixture, so #3383 can stay focused on the common fixture/bootstrap layer.

@mjc mjc force-pushed the mjc/wanted-search-wanted-adaptive branch from 4b3dd62 to f9333a4 Compare June 15, 2026 19:44
@mjc mjc marked this pull request as ready for review June 19, 2026 18:20
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.

1 participant