Repository navigation
fix(notifications): readable cleanup candidate alerts, no duplicate sends - #488
Merged
Merged
Conversation
…ends Cleanup candidate notifications were hard to read on chat transports such as Telegram: - Episode candidates rendered as "Season 1" because the context never loaded the episode, so three episodes of one show looked like three identical lines. Episodes are now loaded and shown as codes, and consecutive episodes compress into ranges (S01E05-E07). - Candidates are grouped per title, so one show is one line with its combined size. max_items now counts titles rather than raw rows. - Reasons no longer include library scoping conditions, which rendered as raw server UUIDs twice per line. A group shows each rule once without per-episode measured values; a single candidate keeps the value. - File names only appear in the "with reasons" detail level. - Telegram receives legacy Markdown, which has no list syntax, so "- " arrived as a literal hyphen. Bullets become glyphs for tgram:// URLs. Fan-out to several users (notify_admins, notify_users, notify_all_users) now sends each event once per destination URL, so two accounts pointing at the same chat no longer receive every message twice.
Owner
|
Hello, thanks for the PR. With a minor fix and correcting the target branch it looks great :) |
jessielw
added a commit
that referenced
this pull request
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cleanup candidate notifications were hard to read on chat transports, Telegram in particular. This fixes the underlying data issues rather than just the formatting, so Discord and email benefit too.
What was wrong
build_cleanup_notification_contextnever loaded theEpisoderow and hard codedepisode_number: None, so three episodes of one show rendered as three identical "Show · Season 1" lines.library.idconditions rendered asLibrary matches any <uuid> (<uuid>). That condition only scopes the rule; it is not why the item matched.notify_admins,notify_usersandnotify_all_usersdid not deduplicate destinations, so two accounts pointing at the same chat got every event twice.-arrived as plain text.Changes
S01E05-E07,S01E10, S02E01.max_itemsnow counts titles instead of raw rows.library.id) from reasons. A group shows each rule once without per episode measured values; a single candidate keeps the value, e.g.Days since watched > 7 (8).top_n_with_reasonsdetail level.tgram://URLs, list markers become bullet glyphs outside code fences.Before / after (Telegram)
Before:
After:
Tests
New tests in
tests/test_notification_formatting.pyandtests/test_notification_delivery.pycover episode codes, reason filtering, Telegram bullets, destination dedupe and the episode lookup in the context builder. The dedupe and episode tests fail on currentmain. Full suite passes (2151 tests). Running it on my own instance (0.6.4, Telegram) since 27 Oct.