diff --git a/backend/src/services/scheduler.ts b/backend/src/services/scheduler.ts index df82cc0..9023c79 100644 --- a/backend/src/services/scheduler.ts +++ b/backend/src/services/scheduler.ts @@ -10,6 +10,7 @@ import { DownloadProgress } from "../types"; let schedulerTask: cron.ScheduledTask | null = null; let isDownloading = false; let currentProgress: DownloadProgress | null = null; +let nextScheduledDownload: Date | null = null; function getRandomVariance(varianceMinutes: number): number { return Math.floor(Math.random() * varianceMinutes * 2) - varianceMinutes; @@ -159,6 +160,7 @@ export function startScheduler() { const varianceMinutes = parseFloat(config.varianceMinutes || "30"); const nextRun = calculateNextRun(intervalMinutes, varianceMinutes); + nextScheduledDownload = nextRun; console.log(`Next download scheduled for: ${nextRun.toLocaleString()}`); const delay = nextRun.getTime() - Date.now(); @@ -193,6 +195,7 @@ export function getSchedulerStatus() { varianceMinutes: parseFloat(config.varianceMinutes || "30"), isDownloading, currentProgress, + nextScheduledDownload: nextScheduledDownload?.toISOString() || null, }; } diff --git a/frontend/src/pages/VideosPage.tsx b/frontend/src/pages/VideosPage.tsx index a55fb18..c87a646 100644 --- a/frontend/src/pages/VideosPage.tsx +++ b/frontend/src/pages/VideosPage.tsx @@ -338,6 +338,14 @@ function VideosPage() { )} + + {schedulerStatus?.enabled && schedulerStatus.nextScheduledDownload && ( +
+ Next scheduled download: {new Date(schedulerStatus.nextScheduledDownload).toLocaleString()} +
+