feat(notifications): add per-episode availability notifications#2869
feat(notifications): add per-episode availability notifications#2869eunux wants to merge 3 commits intoseerr-team:developfrom
Conversation
Add Episode entity with per-episode status/status4k fields, linked to Season via ManyToOne relationship. Includes SQLite and PostgreSQL migrations. Based on work from PR seerr-team#1671 by 0xSysR3ll. This is the data foundation for per-episode availability notifications (issue seerr-team#480).
Add MEDIA_AIRED_EPISODE_AVAILABLE notification type that fires when a newly aired episode becomes available for a requested series. Uses TMDB air date to filter: only episodes that aired after the user's request was submitted trigger a notification, naturally preventing spam from bulk imports, library re-scans, and backfills. Changes: - New EpisodeSubscriber (TypeORM event subscriber) detects episode availability transitions and sends notifications - Notification type added to all 10 agents (Discord, Slack, Telegram, Email, Pushbullet, Pushover, Gotify, Ntfy, WebPush, Webhook) - Frontend notification type selector with "Newly Aired Episode Available" option for both admin and user contexts - i18n strings for all new UI copy Depends on Episode entity from PR seerr-team#1671. Closes seerr-team#480.
Prevent duplicate episode rows from concurrent scan cycles. Follows the same pattern as Blocklist, UserPushSubscription, and Watchlist entities which all use @unique for composite key enforcement. This hardens the Episode entity from PR seerr-team#1671. This commit can be dropped if maintainers prefer to land the constraint with seerr-team#1671.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
This should wait till #1671 edit: sorry I just saw that you mentioned it in description too 😅 |
Description
Adds per-episode availability notifications for requested TV series. Right now
Seerr only notifies you when a request becomes available at the media or season
level, which means if you're following a weekly show you don't hear anything
until the entire season finishes downloading. This adds a more granular
notification so users can find out when newly aired episodes become available.
The use case is basically:
I requested a show thats airing weekly
I want to know when each new episode lands
Fixes Ability to send notifications for new episodes of ongoing seasons #480
Related: [Feature Request] Notification on movie/show status change #891, Granular notifications for partial availability #1361, [Feature Request] Allow episode-level availability notifications for shows currently airing #2027, Notifications for pilot/first episode of a season #2242, Request Available - Expand to single episode releases #2842
This depends partially on the Episode entity work from #1671. The entity and
migration pieces are included here becuase the notification flow needs
episode-level availability records in the data model. The underlying Episode
tracking approach comes from #1671 and this branch is meant to be reviewed as
a dependent follow-up built on that work.
I could have implemented this as a standalone thing without the Episode entity
but #1671 already has the groundwork for episode-level state, so building on
that seemed like the lowest-variance option — keeps the review focussed on the
user-facing behaviour here rather than introducing a competing model for
episode tracking.
Happy to do either of these if maintainers prefer:
How the notifications work:
notification as it becomes available. This is the main use case.
air date on TMDB, per-episode notifications are suppressed and the existing
"Request Available" notification handles it instead.
then go weekly will still send per-episode notifications (the season has
multiple distinct air dates). You get a small burst on premiere day then
one per week after that. This is intentional.
created will trigger notifications. Bulk imports, library re-scans, and
backfills are silently filtered out.
fires once when the entire request completes. "Newly Aired Episode Available"
fires per-episode as they arrive. The UI descriptions clarify the difference.
Season entity note: The Season entity's
updatedAtcolumn was changed fromTypeORM's
UpdateDateColumntoDbAwareColumnto match the Episode entity'stimestamp pattern and stay consistent with #1671. Not a behavioural change for
the notification feature itself.
Unique constraint: The final commit adds
@Unique(['season', 'episodeNumber'])to the Episode entity to prevent duplicate rows from concurrent scans. Same
pattern as
Blocklist,UserPushSubscription, andWatchlist. This commitcan be dropped if maintainers would rather land it with #1671.
AI Disclosure: Used AI tooling to help inspect the codebase and organise
the work. Changes were reviewed manually, PR description is my own words.
How Has This Been Tested?
pnpm lintpnpm testpnpm typecheckpnpm buildpnpm i18n:extractpnpm format:checkScreenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extract