2
0
Fork 0

skip calendar events with empty title

This commit is contained in:
Andreas (@xAndy) Zimmermann 2023-05-06 22:14:48 +02:00
parent 8df85f3abb
commit b93a4fee82
1 changed files with 3 additions and 1 deletions

View File

@ -25,11 +25,13 @@ def import_calendar(calendar):
events = {} events = {}
for event in cal.walk("vevent"): for event in cal.walk("vevent"):
uid = event.decoded("uid").decode() uid = event.decoded("uid").decode()
summary = event.decoded("summary").decode() summary = (event.decoded("summary", None) or b"").decode()
description = (event.decoded("description", None) or b"").decode() description = (event.decoded("description", None) or b"").decode()
start = event.decoded("dtstart").astimezone(timezone.utc) start = event.decoded("dtstart").astimezone(timezone.utc)
end = event.decoded("dtend").astimezone(timezone.utc) end = event.decoded("dtend").astimezone(timezone.utc)
location = event.decoded("location", None) location = event.decoded("location", None)
if not summary:
continue
if location is not None: if location is not None:
location = location.decode() location = location.decode()