Skip to content

Date-numbered episode search#404

Open
rix1337 wants to merge 2 commits into
mainfrom
dev
Open

Date-numbered episode search#404
rix1337 wants to merge 2 commits into
mainfrom
dev

Conversation

@rix1337

@rix1337 rix1337 commented Jun 27, 2026

Copy link
Copy Markdown
Owner

What changed

  • Parse Sonarr year + MM/DD numbering once into a validated shared episode_date.
  • Centralize date query variants, title matching, exact-date validation, and Arr title canonicalization in shared utilities.
  • Enable existing date searches for BY, DD, DJ, DL, DT, DW, FX, HE, HS, MB, NK, NX, RM, SF, SJ, SL, WD, and WX.
  • Keep AL/AT disabled because their anime-specific numbering paths require numeric episodes; keep MX disabled because its API requires numeric season and episode; FF remains movie-only.
  • Remove WWE/RAW/SmackDown-specific production logic while preserving both motivating WWE series through generic schedule-word and mixed-case handling.

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

  • Normal movie, season/episode, document, music, and feed paths remain unchanged when episode_date is absent.
  • No config or hostname changes.
  • Compatible TV sources reuse their existing IMDb/title lookup and candidate-result paths.

Verification

  • uv run python -X utf8 pre-commit.py: passed; 149 tests.
  • uv run ruff check .: passed.
  • uv run ruff format --check .: passed.
  • Latest main (c965cc5): 134 tests and Ruff passed in a detached worktree.
  • Identical nine-case non-date matching corpus on latest main and this branch: movie acceptance/rejection, exact/wrong TV episode, season pack, movie-as-TV rejection, document result, and episode-range acceptance/rejection.
  • Synthetic DL thread tests find and canonicalize both WWE RAW and WWE SmackDown date-numbered cases.
  • Production scan contains no WWE or SmackDown literals outside the untouched obfuscated asset.
  • Source transport diff audit found no endpoint/request/payload changes.

Bartyboy and others added 2 commits June 27, 2026 11:53
@rix1337

rix1337 commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

@daddy-cool please have a look. I don't want to break our architectural pattern for a niche request.

@rix1337

rix1337 commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

@Bartyboy please pull and test the new :beta docker image to verify your use case works.

Docker:

docker pull ghcr.io/rix1337/quasarr:beta

Python:

uv tool install https://github.com/rix1337/Quasarr/releases/download/beta/quasarr-4.6.2-py3-none-any.whl

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06acc668dc

ℹ️ 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".

return releases
search_string = html.unescape(search_string)
if season:
if season and episode_date is None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid appending premiere years to DD date searches

When episode_date is present, season is the air-date year, but this condition sends date-numbered TV searches into the else branch that appends get_year(imdb_id) to the DD keyword. That makes DD query strings like Show 1996 for releases titled with the air date (for example Show.2026.06.19...), so those date-numbered episodes are likely missed before the new exact-date validation ever runs; keep the year suffix for movie/no-season searches only.

Useful? React with 👍 / 👎.


@property
def supports_date_numbering(self) -> bool:
return True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should default to True, sources that support it should explicitly define this instead

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

timeout = SEARCH_REQUEST_TIMEOUT_SECONDS

if season:
if season and episode_date is None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert, NK does not support date searches

timeout = SEARCH_REQUEST_TIMEOUT_SECONDS

if season:
if season and episode_date is None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert, HE could support date searches but this requires dedicated support

+ "'),",
" StringStruct(u'InternalName', u'Quasarr'),",
" StringStruct(u'LegalCopyright', u'Copyright © RiX'),",
" StringStruct(u'LegalCopyright', u'Copyright \\u00a9 RiX'),",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

@daddy-cool

daddy-cool commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

I see a lot of "if season and episode_date is None:" and no other changes to sources, which causes these Sources to do only Season based searches in date-mode. This seems like a crude workaround to not get errors instead of adding proper date-mode support to these sources.

This problem was already fixed in my original PR, where I cleared season and episode explicitly in favor of the additional date-param.
episode is expected to be an integer, however in date-mode episode will be a non-numeric string currently, this has to be addressed.

Reference for fix:
#395

@Bartyboy

This comment was marked as resolved.

@rix1337

This comment was marked as resolved.

@Bartyboy

Copy link
Copy Markdown

ok, no problem.
The beta is working for me. I can handle the prefix sonarr-sided.

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.

3 participants