fix(requests): skip seasons with no episodes when requesting all seasons#2698
fix(requests): skip seasons with no episodes when requesting all seasons#2698Xyerophyte wants to merge 1 commit intoseerr-team:developfrom
Conversation
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
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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 > 0filter when resolvingseasons: '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.
gauthier-th
left a comment
There was a problem hiding this comment.
Please update the PR description to match the PR template.
|
Hey @Xyerophyte, thanks for submitting this PR! However, it looks like the PR template hasn't been fully filled out. Issues found:
Please update your PR description to follow the PR template. This check will automatically re-run when you edit your PR description. |
|
@Xyerophyte any update? |
Summary
episode_count === 0when processingseasons: 'all'requests, preventing phantom season requests for announced-but-unproduced seasons.What changed
In
server/entity/MediaRequest.ts, addedseason.episode_count > 0to 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()withseasons: '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
seasons: 'all'where TMDB has a season withepisode_count: 0— verify that season is not included in the requestseason_number === 0) is unaffectedCloses #2646
Summary by CodeRabbit