feat(notify): configurable plain/html summary formatting
Rework the Pushover/Apprise summary so it reads as a report instead of a
dump of counters.
- Extract build_summary() as the single source of truth for both notifiers,
removing the duplicated body string and the stray leading indentation
caused by backslash line continuations.
- Add a 'format' option: 'plain' (aligned columns) or 'html' (bold labels,
sets html=1 for Pushover). Apprise always receives the plain body.
- Add 'use_emoji' for emoji-prefixed rows.
- Title now states the outcome ('7 torrents removed') instead of
'--- qbit-maid summary ---'.
- Say 'Would remove' when delete_torrents is false, so a dry run is never
mistaken for a real deletion.
- Format runtime as 12s / 1m 04s instead of a timedelta with microseconds.
- Add include_hostname, notify_on_empty, priority, sound, retry and expire.
- Log notification failures instead of letting them abort the run.
- Cover the new formatting with unit tests; document the options in the
README and config.toml.example.
This commit is contained in:
1 parent
ebec893a85
commit
881765cdf5
4 files changed
+548
-28
No files matched your search
+14
-3
@@ -23,8 +23,19 @@ delete_torrents = false
|
||||
|
||||
[pushover]
|
||||
use_pushover = false
|
||||
po_key = "<key>>"
|
||||
po_token = "<token>>"
|
||||
po_key = "<key>"
|
||||
po_token = "<token>"
|
||||
# Notification formatting
|
||||
# format: "plain" (aligned text) or "html" (bold labels, Pushover HTML)
|
||||
format = "plain"
|
||||
use_emoji = false
|
||||
include_hostname = false
|
||||
notify_on_empty = true
|
||||
# Optional: -2..2. Priority 2 also needs retry/expire (defaults shown).
|
||||
# priority = 0
|
||||
# sound = "pushover"
|
||||
# retry = 60
|
||||
# expire = 3600
|
||||
|
||||
[apprise]
|
||||
use_apprise = false
|
||||
@@ -51,4 +62,4 @@ save = "save"
|
||||
|
||||
[healthcheck]
|
||||
use_healthcheck = true
|
||||
healthcheck_url = "https://example.com/ping/<uuid>>"
|
||||
healthcheck_url = "https://example.com/ping/<uuid>>"
|
||||
Reference in new issue
Block a user