feat(sel): add multiEpisode filter function#798
Conversation
Adds a new SEL function `multiEpisode(streams, minEpisodes?)` that filters streams based on the number of parsed episodes. This enables users to exclude multi-episode packs (e.g. S01E01-E08) while keeping single episode results, including those selected from cached season pack folders. The existing `seasonPack` function cannot distinguish between a single episode selected from a pack and a multi-episode file, since `onlySeasons` mode only catches packs with no episode info, and `seasonPack` mode is too aggressive (also excludes single files from pack folders). `multiEpisode` fills this gap by checking `parsedFile.episodes.length` directly. Usage in excluded stream expressions: multiEpisode(streams) — excludes streams with 2+ episodes multiEpisode(streams, 3) — excludes streams with 3+ episodes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
Summary
multiEpisode(streams, minEpisodes?)that filters streams based onparsedFile.episodes.lengthMotivation
The existing
seasonPackfunction can't cleanly distinguish multi-episode files from single episodes:seasonPack(streams, 'onlySeasons')only catches packs with no episode info (e.g. "S01") — misses packs like "S01E01-E08" where episodes are parsedseasonPack(streams, 'seasonPack')is too aggressive — also excludes single episodes selected from cached season pack folders (via thefolderSize > size * 2heuristic)multiEpisodefills this gap by checking the episodes array length directly.Usage
In excluded stream expressions:
Combined with
seasonPack(streams, 'onlySeasons'), this covers all season pack variants:seasonPack('onlySeasons')multiEpisodeTest plan
multiEpisode(streams)returns streams withparsedFile.episodes.length >= 2multiEpisode(streams, 3)respects custom thresholdSummary by CodeRabbit
Release Notes