From ea818bf899f50e2faafca56a79a27ec0909f035a Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 30 Jun 2023 20:13:07 +0200 Subject: [PATCH] Fix fetchInterval for sample calendar (#3139) fixes #3138 just in case #3137 doesnt get worked on until the next release - inc fetchInterval for sample calender - add fetchInterval config per calendar --- CHANGELOG.md | 4 ++++ config/config.js.sample | 3 ++- modules/default/calendar/calendar.js | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87afbde8..d2198878 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ _This release is scheduled to be released on 2023-07-01._ - Added no-param-reassign eslint rule and fix warnings - updatenotification: Added `sendUpdatesNotifications` feature. Broadcast update with `UPDATES` notification to other modules - updatenotification: allow force scanning with `SCAN_UPDATES` notification from other modules +- Added per-calendar fetchInterval ### Removed @@ -30,6 +31,9 @@ _This release is scheduled to be released on 2023-07-01._ - Refactor formatTime into common util function for default modules - Refactor some calendar methods into own class and added tests for them - Split install and run commands in github actions +- Changed `fetchInterval` of calendar in `config.js.sample` to 7 days so we not to request example calendar too frequently +- Changed default calendar fetchInterval to one hour +- Changed calendar url in sample config ### Fixed diff --git a/config/config.js.sample b/config/config.js.sample index 799153b6..e54be6fa 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -55,8 +55,9 @@ let config = { config: { calendars: [ { + fetchInterval: 7 * 24 * 60 * 60 * 1000, symbol: "calendar-check", - url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics" + url: "https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics" } ] } diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 250c635c..3343d347 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -21,11 +21,11 @@ Module.register("calendar", { defaultRepeatingCountTitle: "", maxTitleLength: 25, maxLocationTitleLength: 25, - wrapEvents: false, // wrap events to multiple lines breaking at maxTitleLength + wrapEvents: false, // Wrap events to multiple lines breaking at maxTitleLength wrapLocationEvents: false, maxTitleLines: 3, maxEventTitleLines: 3, - fetchInterval: 5 * 60 * 1000, // Update every 5 minutes. + fetchInterval: 60 * 60 * 1000, // Update every hour animationSpeed: 2000, fade: true, urgency: 7, @@ -683,7 +683,7 @@ Module.register("calendar", { maximumEntries: calendarConfig.maximumEntries || this.config.maximumEntries, maximumNumberOfDays: calendarConfig.maximumNumberOfDays || this.config.maximumNumberOfDays, pastDaysCount: calendarConfig.pastDaysCount || this.config.pastDaysCount, - fetchInterval: this.config.fetchInterval, + fetchInterval: calendarConfig.fetchInterval || this.config.fetchInterval, symbolClass: calendarConfig.symbolClass, titleClass: calendarConfig.titleClass, timeClass: calendarConfig.timeClass,