Skip to content

Commit da0489f

Browse files
authored
Merge pull request #2866 from kolbyjack/broadcast-duplicate-events
Include duplicate events in broadcasts
2 parents 47aefb0 + c82de1e commit da0489f

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ _This release is scheduled to be released on 2022-07-01._
2020
- Use latest node 18 when running tests on github actions
2121
- Update `electron` to v19 and other dependencies.
2222
- Use internal fetch function of node instead external `node-fetch` library if used node version >= `v18`.
23+
- Include duplicate events in broadcasts.
2324

2425
### Fixed
2526

modules/default/calendar/calendar.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -496,22 +496,20 @@ Module.register("calendar", {
496496
for (const e in calendar) {
497497
const event = JSON.parse(JSON.stringify(calendar[e])); // clone object
498498

499-
if (event.endDate < now && limitNumberOfEntries) {
499+
if (this.config.hidePrivate && event.class === "PRIVATE") {
500+
// do not add the current event, skip it
500501
continue;
501502
}
502-
if (this.config.hidePrivate) {
503-
if (event.class === "PRIVATE") {
504-
// do not add the current event, skip it
503+
if (limitNumberOfEntries) {
504+
if (event.endDate < now) {
505505
continue;
506506
}
507-
}
508-
if (this.config.hideOngoing && limitNumberOfEntries) {
509-
if (event.startDate < now) {
507+
if (this.config.hideOngoing && event.startDate < now) {
508+
continue;
509+
}
510+
if (this.listContainsEvent(events, event)) {
510511
continue;
511512
}
512-
}
513-
if (this.listContainsEvent(events, event)) {
514-
continue;
515513
}
516514
event.url = calendarUrl;
517515
event.today = event.startDate >= today && event.startDate < today + 24 * 60 * 60 * 1000;

0 commit comments

Comments
 (0)