Skip to content

Development#580

Merged
g0ldyy merged 6 commits into
mainfrom
development
Apr 26, 2026
Merged

Development#580
g0ldyy merged 6 commits into
mainfrom
development

Conversation

@g0ldyy

@g0ldyy g0ldyy commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Refactor

    • Improved episode-matching logic to better handle series lookups and unknown episode files
  • Chore

    • Database schema migration updates

g0ldyy added 6 commits March 21, 2026 13:12
Added a new function to determine episode matching criteria based on media type, season, and episode number. Updated the stream function to utilize this policy, enhancing the handling of IMDB episode requests and refining the logic for rejecting unknown episode files.
feat: implement episode matching policy for improved media handling
@g0ldyy g0ldyy merged commit e2dc155 into main Apr 26, 2026
2 of 3 checks passed
@coderabbitai

coderabbitai Bot commented Apr 26, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d51896b-70cc-4fb3-b36f-4315efa2f0ed

📥 Commits

Reviewing files that changed from the base of the PR and between d39a0e1 and 02c0569.

📒 Files selected for processing (2)
  • comet/api/endpoints/stream.py
  • comet/core/schema_migrations.py

Walkthrough

The PR refactors episode-matching logic in the stream endpoint by decoupling IMDb series episode detection from unknown episode file rejection, introducing separate is_imdb_episode_request and reject_unknown_episode_files flags computed via a new _episode_matching_policy function. Additionally, three backfill INSERT statements in schema migrations are updated with WHERE 1=1 clauses.

Changes

Cohort / File(s) Summary
Episode-Matching Logic Refactoring
comet/api/endpoints/stream.py
Introduces _episode_matching_policy function to separate IMDb episode request detection from unknown episode file rejection logic. Air-date resolution now gated by is_imdb_episode_request; reject_unknown_episode_files computed with additional conditions. Updated log message and propagates new flags into TorrentManager and get_account_torrents_for_media.
Schema Migration Backfill Updates
comet/core/schema_migrations.py
Adds WHERE 1=1 clause to three INSERT INTO ... SELECT ... ON CONFLICT DO UPDATE statements in _migration_backfill_canonical_tables for metadata_cache, digital_release_cache, and first_searches tables.

Possibly related PRs


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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