🐛 fix overlap detection logic
This commit is contained in:
parent
11c6d4d48e
commit
3302a7abf8
|
|
@ -472,10 +472,8 @@ def find_overlapping_events(events: list[DavEvent]) -> dict:
|
||||||
if event.uid == compare_event.uid:
|
if event.uid == compare_event.uid:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Skip if the compare_event is already in the overlapping events
|
# Skip if the compare_event is already canceled
|
||||||
# dictionary or if it is already canceled
|
if compare_event.is_cancelled:
|
||||||
if (overlapping_events.get(compare_event.extended_uid)
|
|
||||||
or compare_event.is_cancelled):
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Check if the events overlap
|
# Check if the events overlap
|
||||||
|
|
@ -497,12 +495,12 @@ def find_overlapping_events(events: list[DavEvent]) -> dict:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Add to overlapping events dictionary
|
# Add to overlapping events dictionary
|
||||||
if e := overlapping_events.get(event.extended_uid):
|
if e := overlapping_events.get(compare_event.extended_uid):
|
||||||
# If the event is already in the dictionary, extend the overlaps
|
# If the event is already in the dictionary, extend the overlaps
|
||||||
e["overlaps_with"].append(event)
|
e["overlaps_with"].append(event)
|
||||||
else:
|
else:
|
||||||
# Create a new entry for the overlapping event
|
# Create a new entry for the overlapping event
|
||||||
overlapping_events[event.extended_uid] = {
|
overlapping_events[compare_event.extended_uid] = {
|
||||||
"event": compare_event,
|
"event": compare_event,
|
||||||
"overlaps_with": [event]
|
"overlaps_with": [event]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue