Skip to content

Add notify_on_download_start option (#486)#494

Merged
nitrobass24 merged 1 commit into
developfrom
feat/notify-download-start
May 19, 2026
Merged

Add notify_on_download_start option (#486)#494
nitrobass24 merged 1 commit into
developfrom
feat/notify-download-start

Conversation

@nitrobass24
Copy link
Copy Markdown
Owner

@nitrobass24 nitrobass24 commented May 18, 2026

Summary

  • Adds a new notify_on_download_start notifications flag (default False) that emits a download_start event when a file transitions into DOWNLOADING.
  • Fires through the existing webhook, Discord, and Telegram channels — no new transport code; just a new branch in WebhookNotifier._resolve_event_type plus label/color entries in notification_formatters.py.
  • Settings UI gains a new "Notify on download start" checkbox under Notifications.

Closes #486.

Why default False?

Downloads start far more often than they complete (one per file vs. one per completed batch in some workflows). Opt-in keeps existing installs from suddenly being noisier after upgrade.

Test plan

  • cd src/angular && npx ng lint — passes
  • cd src/angular && npx ng test — 413 tests pass, including the updated config.service.spec.ts fixture
  • cd src/python && pytest tests/unittests/test_controller/test_notifier.py tests/unittests/test_controller/test_notification_formatters.py tests/unittests/test_common/test_config.py — 64 tests pass, including:
    • 3 new tests for DEFAULT → DOWNLOADING and QUEUED → DOWNLOADING transitions, plus the disabled-flag case
    • Updated test_to_file golden config string with the new field
    • Auto-coverage of download_start label and color via existing EVENT_LABELS / DISCORD_COLORS iteration, plus an explicit assertion

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added optional notifications for download start events. Users can enable "Notify on download start" in settings to receive alerts through webhooks, Discord, and Telegram when downloads begin. Disabled by default with custom Discord formatting.

Review Change Stack

Emits a download_start event when a file enters the DOWNLOADING state,
gated by a new notify_on_download_start flag (default False). Fires
through the existing webhook, Discord, and Telegram channels with a
"Download Started" label and yellow Discord embed color.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

This PR adds a new notify_on_download_start configuration option that emits a download_start event when files enter the DOWNLOADING state. Changes include configuration schemas in both Angular and Python, UI settings, event routing logic, notification formatters, comprehensive unit tests, and changelog documentation.

Changes

Download Start Notification Feature

Layer / File(s) Summary
Configuration Schemas
src/angular/src/app/models/config.ts, src/python/common/config.py, src/angular/src/app/services/settings/config.service.spec.ts
Added notify_on_download_start boolean field to Notifications interface and class in both Angular (nullable) and Python (False default); updated test config helpers to include the new field.
Settings UI
src/angular/src/app/pages/settings/options-list.ts
Added checkbox option "Notify on download start" to notification settings group, wired to notifications.notify_on_download_start config path.
Event Routing and Formatting
src/python/controller/notifier.py, src/python/controller/notification_formatters.py
Notifier maps DOWNLOADING state to download_start event when flag is enabled; formatters register event label ("Download Started") and Discord embed color (0xFEE75C yellow) for consistent presentation.
Tests and Validation
src/python/tests/unittests/test_common/test_config.py, src/python/tests/unittests/test_controller/test_notification_formatters.py, src/python/tests/unittests/test_controller/test_notifier.py
Config serialization test updated; Discord formatter test validates label and color mappings; notifier tests verify webhook dispatch fires once when enabled, not when disabled, and payload includes correct event_type; existing test suites adjusted to disable feature.
Documentation
CHANGELOG.md
Added unreleased entry documenting new notify_on_download_start option and download_start event routing across webhook, Discord, and Telegram channels.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • nitrobass24/seedsync#428: The main PR's notify_on_download_start work extends the same notifier/formatter event-type system introduced in PR #428 by adding the new download_start label/color mappings and making WebhookNotifier route DOWNLOADING to that new event type.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add notify_on_download_start option (#486)' is clear and directly reflects the main change: adding a new notification option for download start events.
Linked Issues check ✅ Passed The PR successfully implements the requirement from #486 to provide a notification option when downloads start, with the feature properly integrated across config, UI, and notification systems.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the notify_on_download_start feature; no out-of-scope modifications detected.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/notify-download-start

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

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Around line 3-8: Replace the top "## [Unreleased]" heading with a new release
header in the format "## [x.y.z] - YYYY-MM-DD" and move the existing "### Added"
content under that new release; ensure the new release block contains the
required section headings "Changed", "Added", "Fixed", "Removed", and "Security"
(add empty placeholders under any sections without items). Specifically update
the header that currently reads "## [Unreleased]" and keep the existing bullet
"- **Notify on download start** — New `notify_on_download_start` option..."
under the "Added" section while adding the five required subheadings beneath the
new release heading.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 63e47d2f-227b-4c3d-8483-322c437d118f

📥 Commits

Reviewing files that changed from the base of the PR and between 8806d96 and b5aa1b1.

📒 Files selected for processing (10)
  • CHANGELOG.md
  • src/angular/src/app/models/config.ts
  • src/angular/src/app/pages/settings/options-list.ts
  • src/angular/src/app/services/settings/config.service.spec.ts
  • src/python/common/config.py
  • src/python/controller/notification_formatters.py
  • src/python/controller/notifier.py
  • src/python/tests/unittests/test_common/test_config.py
  • src/python/tests/unittests/test_controller/test_notification_formatters.py
  • src/python/tests/unittests/test_controller/test_notifier.py

Comment thread CHANGELOG.md
Comment on lines +3 to +8
## [Unreleased]

### Added

- **Notify on download start** — New `notify_on_download_start` option (disabled by default) emits a `download_start` event when a file enters the `DOWNLOADING` state. Fires through the existing webhook, Discord, and Telegram channels, with a yellow Discord embed color and "Download Started" label. (#486)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace Unreleased with a dated semver release block that includes all required sections.

Line 3 uses an Unreleased heading, but this repository requires a top entry like ## [x.y.z] - YYYY-MM-DD, and the entry must include Changed, Added, Fixed, Removed, and Security sections (even if some are empty placeholders).

As per coding guidelines, "Update CHANGELOG.md with a new version entry at the top following semver (major.minor.patch) with date in YYYY-MM-DD format and sections: Changed, Added, Fixed, Removed, Security".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` around lines 3 - 8, Replace the top "## [Unreleased]" heading
with a new release header in the format "## [x.y.z] - YYYY-MM-DD" and move the
existing "### Added" content under that new release; ensure the new release
block contains the required section headings "Changed", "Added", "Fixed",
"Removed", and "Security" (add empty placeholders under any sections without
items). Specifically update the header that currently reads "## [Unreleased]"
and keep the existing bullet "- **Notify on download start** — New
`notify_on_download_start` option..." under the "Added" section while adding the
five required subheadings beneath the new release heading.

@nitrobass24 nitrobass24 merged commit eedf863 into develop May 19, 2026
18 checks passed
@nitrobass24 nitrobass24 deleted the feat/notify-download-start branch May 19, 2026 16:44
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.

Notify on download start

1 participant