Narrow reminder window to exact day to prevent re-fires on restart; v1.1.29

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-08-05 11:29:14 -04:00
parent f53dcdec4f
commit 78f0988d75
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "siteforge", "name": "siteforge",
"private": true, "private": true,
"version": "1.1.28", "version": "1.1.29",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+2 -2
View File
@@ -25,7 +25,7 @@ async function checkReminders() {
if (isNaN(publish.getTime())) continue if (isNaN(publish.getTime())) continue
const reminderDate = new Date(publish) const reminderDate = new Date(publish)
reminderDate.setUTCDate(reminderDate.getUTCDate() - ep.reminderDays) reminderDate.setUTCDate(reminderDate.getUTCDate() - ep.reminderDays)
if (todayKey >= toDateKey(reminderDate) && todayKey <= toDateKey(publish)) { if (todayKey === toDateKey(reminderDate)) {
const sent = await sendReminderEmail({ const sent = await sendReminderEmail({
label: ep.episodeNumber ? `Episode ${ep.episodeNumber}` : 'Episode', label: ep.episodeNumber ? `Episode ${ep.episodeNumber}` : 'Episode',
title: ep.title || 'Untitled', title: ep.title || 'Untitled',
@@ -50,7 +50,7 @@ async function checkReminders() {
if (isNaN(publish.getTime())) continue if (isNaN(publish.getTime())) continue
const reminderDate = new Date(publish) const reminderDate = new Date(publish)
reminderDate.setUTCDate(reminderDate.getUTCDate() - ev.reminderDays) reminderDate.setUTCDate(reminderDate.getUTCDate() - ev.reminderDays)
if (todayKey >= toDateKey(reminderDate) && todayKey <= toDateKey(publish)) { if (todayKey === toDateKey(reminderDate)) {
const sent = await sendReminderEmail({ const sent = await sendReminderEmail({
label: ev.type.charAt(0).toUpperCase() + ev.type.slice(1), label: ev.type.charAt(0).toUpperCase() + ev.type.slice(1),
title: ev.title, title: ev.title,