From c2382d8b4cf93489614c5fe70a604ab698b9f613 Mon Sep 17 00:00:00 2001 From: Jason McCormick Date: Thu, 5 Nov 2026 18:37:48 -0500 Subject: feat: 1-minute watcher and per-stanza email subject/header Run the notification timer every minute and shrink the scan window to match. Each upload URI stanza may now set subject and body_header to override the default notification text. Co-Authored-By: Claude Opus 5.5 --- watcher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'watcher.py') diff --git a/watcher.py b/watcher.py index 9799bae..e5df0b6 100644 --- a/watcher.py +++ b/watcher.py @@ -20,7 +20,7 @@ from urllib.parse import quote from server import DEFAULT_CONFIG_FILE, AppConfig, load_config -SCAN_INTERVAL_SECONDS = 5 * 60 +SCAN_INTERVAL_SECONDS = 60 IMAGE_SUFFIXES = {".jpg", ".png", ".heic"} SUBJECT = "New upload received" BODY = "A new file has been uploaded to your private drop." @@ -71,11 +71,11 @@ def build_message(config: AppConfig, target: str, target_dir: Path, filenames: l message = EmailMessage() message["From"] = config.smtp.send_as message["To"] = config.recipients[target] - message["Subject"] = SUBJECT + message["Subject"] = config.subjects.get(target, SUBJECT) message["Date"] = formatdate(localtime=True) message["Message-ID"] = make_msgid(domain=config.smtp.send_as.rsplit("@", 1)[1]) prefix = config.view_url_prefixes.get(target) - sections = [BODY] + sections = [config.body_headers.get(target, BODY)] for name in filenames: # Stored names are server-generated hex plus an extension, so they are URL-safe. heading = prefix + quote(name) if prefix else f"File: {name}" -- cgit v1.2.3