library/calendar_sync.py aktualisiert
This commit is contained in:
@ -53,10 +53,12 @@ def sync_ics_to_caldav(module):
|
|||||||
|
|
||||||
existing_events = {}
|
existing_events = {}
|
||||||
for event in target_cal.events():
|
for event in target_cal.events():
|
||||||
|
if not event or not event.data:
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
for calendar in vobject.readComponents(event.data):
|
for calendar in vobject.readComponents(event.data):
|
||||||
for component in calendar.components():
|
for component in calendar.components():
|
||||||
if component.name == 'VEVENT':
|
if component.name == 'VEVENT' and hasattr(component, "uid"):
|
||||||
uid = str(component.uid)
|
uid = str(component.uid)
|
||||||
existing_events[uid] = event
|
existing_events[uid] = event
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -110,4 +112,3 @@ def run_module():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run_module()
|
run_module()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user