Harden sync and subtitle-upgrade metadata parsing - #3388
Open
mjc wants to merge 16 commits into
Open
Conversation
mjc
marked this pull request as draft
June 12, 2026 05:26
Contributor
Author
|
Stack note for review: this branch is intentionally based on the PR #3383 test harness branch in my fork, but the upstream PR targets |
mjc
force-pushed
the
mjc/wanted-search-sync-upgrade
branch
2 times, most recently
from
June 14, 2026 17:31
33b59d9 to
18e403d
Compare
mjc
force-pushed
the
mjc/wanted-search-sync-upgrade
branch
from
June 19, 2026 17:50
18e403d to
e33e821
Compare
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
- add sync profile tests for malformed language/profile API payloads - guard sync and profile parsing code against None/non-dict/non-string values - make subtitle sync/cache helpers resilient to malformed or missing language fields Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- add upgrade path tests for malformed profile/audio payloads and safe notification behavior - guard database profile helpers against malformed profile dictionaries and invalid audio payloads - make upgrade language/profile handling tolerant of missing keys and invalid item shapes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- keep get_video sceneName sentinel behavior by ignoring None values - return empty code3 fallback for missing subtitle language metadata - skip upgrade attempts when parsed language is empty - preserve explicit subsync threshold value 0 during conversion - guard Sonarr/Radarr profile parsing against non-dict entries - harden Sonarr/Radarr sync loops against malformed series/movie payloads - guard profile cutoff iteration when items is non-list - remove dead nested test class and add regressions for non-dict profiles and empty parsed language Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mjc
force-pushed
the
mjc/wanted-search-sync-upgrade
branch
from
June 19, 2026 18:15
e33e821 to
71e721c
Compare
mjc
marked this pull request as ready for review
June 19, 2026 18:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR hardens sync, profile parsing, subtitle cache, subtitle sync, and subtitle-upgrade paths that feed later wanted-search normalization work.
The goal is to preserve valid Radarr/Sonarr/profile/history/cache data while skipping malformed entries instead of letting one bad payload crash or corrupt the broader sync/upgrade operation.
What changed
.strmdetection, or movie parsing.Nonerather than converting them to a literal string.Why this is separate
Sync/profile/upgrade/cache data is upstream of wanted-search state. Making these readers defensive first keeps the later normalized wanted-state PR focused on storage and query performance, while ensuring malformed external payloads do not poison the state that wanted search consumes.
Tests
The added tests cover malformed Radarr/Sonarr profile payloads, non-list API payloads, malformed movie-file metadata, mixed valid/malformed sync entries, bad upgrade language/profile data, missing audio-language rows, missing history scores, notification results without messages, malformed subtitle-cache entries, malformed subtitle-sync score thresholds, and callback safety. The tests use the shared transactional fixture layer so valid entries can be asserted alongside skipped malformed entries.