Generalize date-numbered episode search#403
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0024036c13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not date_match: | ||
| return title | ||
|
|
||
| canonical_prefix = re.sub(r"[^\w]+", ".", str(search_string)).strip(".") |
There was a problem hiding this comment.
Strip query dates before canonicalizing release titles
When DL searches a date-numbered episode it iterates generated queries from date_numbering_search_strings(), including variants like Sample Show 2031.02.02/03/04, and passes that query into this helper. Because the prefix is built from the whole query, a match titled Sample.Show.2031.02.03.1080p-GRP can be returned as Sample.Show.2031.02.02.2031.02.03.1080p-GRP (or duplicate the same date), so the result name sent to Sonarr is malformed and may be rejected or misparsed.
Useful? React with 👍 / 👎.
What changed
MM/DDnumbering once into a validated sharedepisode_date.Why
PR #400 established date-numbered searching in DL, but left source-specific date fields and WWE-specific aliases. This follow-up makes date numbering a shared search capability without changing any source endpoint, HTTP method, parameter name, payload shape, or response parser.
Impact
episode_dateis absent.Verification
uv run python -X utf8 pre-commit.py: passed; 149 tests.uv run ruff check .: passed.uv run ruff format --check .: passed.main(c965cc5): 134 tests and Ruff passed in a detached worktree.mainand this branch: movie acceptance/rejection, exact/wrong TV episode, season pack, movie-as-TV rejection, document result, and episode-range acceptance/rejection.