Skip to content

fix(requests): skip seasons with no episodes when requesting all seasons#2698

Open
Xyerophyte wants to merge 1 commit intoseerr-team:developfrom
Xyerophyte:fix/watchlist-sync-empty-seasons
Open

fix(requests): skip seasons with no episodes when requesting all seasons#2698
Xyerophyte wants to merge 1 commit intoseerr-team:developfrom
Xyerophyte:fix/watchlist-sync-empty-seasons

Conversation

@Xyerophyte
Copy link
Copy Markdown

@Xyerophyte Xyerophyte commented Mar 14, 2026

Summary

  • Filter out TMDB seasons with episode_count === 0 when processing seasons: 'all' requests, preventing phantom season requests for announced-but-unproduced seasons.
  • This fixes the watchlist sync loop where deleted requests for non-existent seasons reappear on every sync cycle.

What changed

In server/entity/MediaRequest.ts, added season.episode_count > 0 to the existing season filter that already excludes specials (season_number !== 0). This ensures only seasons with actual episodes are included when a request is made for all seasons.

Root cause

TMDB often lists placeholder seasons (e.g., Season 3 with 0 episodes) for shows where a future season has been announced but not yet produced. When watchlist sync calls MediaRequest.request() with seasons: 'all', these empty seasons were included in the request. Since the item remains on the user's Plex watchlist, deleting the request just causes it to be recreated on the next sync.

Test plan

  • Request a TV show with seasons: 'all' where TMDB has a season with episode_count: 0 — verify that season is not included in the request
  • Verify watchlist sync does not create requests for zero-episode seasons
  • Verify normal season requests (seasons with episodes) still work as expected
  • Verify specials handling (season_number === 0) is unaffected

Closes #2646

Summary by CodeRabbit

  • Bug Fixes
    • Fixed TV show season selection to exclude incomplete or placeholder seasons, providing more accurate season availability for users.

When watchlist sync (or any 'all' season request) runs, TMDB may list
placeholder seasons with episode_count of 0 for announced but
unproduced seasons. These were being included in the request, causing
phantom season requests that reappear on every sync cycle after
deletion.

Filter out seasons where episode_count is 0 alongside the existing
specials filter, so only seasons with actual episodes are requested.

Closes seerr-team#2646

Made-with: Cursor
@Xyerophyte Xyerophyte requested a review from a team as a code owner March 14, 2026 22:17
Copilot AI review requested due to automatic review settings March 14, 2026 22:17
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 14, 2026

📝 Walkthrough

Walkthrough

The change filters out invalid seasons (those with season_number equal to 0 or no episodes) in the TV media request handling logic for watchlist sync to prevent creating requests for non-existent seasons.

Changes

Cohort / File(s) Summary
Season Filtering Logic
server/entity/MediaRequest.ts
Added filter conditions to exclude seasons where season_number is 0 and to ensure episode_count > 0 before selecting seasons for media requests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested labels

bug, severity: medium

Suggested reviewers

  • gauthier-th
  • 0xSysR3ll

Poem

🐰 A season with no episodes? How absurd!
We hopped to the filter, let logic be heard,
Now zero and empty are pushed far away,
Only real seasons in requests will stay! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: excluding seasons with no episodes when requesting all seasons, which directly addresses the root cause identified in the linked issue.
Linked Issues check ✅ Passed The code change directly implements the required fix by filtering out TMDB placeholder seasons with episode_count === 0 in addition to excluding specials, which prevents watchlist sync from creating requests for non-existent seasons [#2646].
Out of Scope Changes check ✅ Passed The change is narrowly focused on the season filtering logic in MediaRequest.ts and directly addresses the stated objective without introducing unrelated modifications.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Filters out TMDB seasons with zero episodes when processing "all seasons" TV requests, preventing phantom requests for announced-but-unproduced seasons that cause watchlist sync loops.

Changes:

  • Added season.episode_count > 0 filter when resolving seasons: 'all' requests to skip placeholder seasons with no episodes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown
Contributor

@0xSysR3ll 0xSysR3ll left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@gauthier-th gauthier-th left a comment

Choose a reason for hiding this comment

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

Please update the PR description to match the PR template.

@fallenbagel fallenbagel added blocked This issue can't be solved for now pending author's response labels Mar 21, 2026
@fallenbagel fallenbagel added this to the v3.2.0 milestone Mar 28, 2026
@fallenbagel fallenbagel removed the blocked This issue can't be solved for now label Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Hey @Xyerophyte, thanks for submitting this PR! However, it looks like the PR template hasn't been fully filled out.

Issues found:

  • Description section is empty or only contains placeholder text.
  • How Has This Been Tested? section is empty.
  • Checklist section is missing or has been removed.
  • The contribution guidelines checkbox has not been checked.
  • The AI disclosure checkbox has not been checked.

Please update your PR description to follow the PR template.
Incomplete or missing PR descriptions may indicate insufficient review of the changes, and PRs that do not follow the template may be closed without review.
See our Contributing Guide for more details.

This check will automatically re-run when you edit your PR description.

@gauthier-th
Copy link
Copy Markdown
Member

@Xyerophyte any update?

@seerr-automation-bot seerr-automation-bot removed this from the v3.2.0 milestone Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watchlist sync creates requests for seasons that don't exist

6 participants