From b93a4fee82481c37adc824418ceb33ef5268aa63 Mon Sep 17 00:00:00 2001 From: "Andreas (@xAndy) Zimmermann" Date: Sat, 6 May 2023 22:14:48 +0200 Subject: [PATCH] skip calendar events with empty title --- shiftregister/importer/importer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shiftregister/importer/importer.py b/shiftregister/importer/importer.py index f006417..629ff6c 100644 --- a/shiftregister/importer/importer.py +++ b/shiftregister/importer/importer.py @@ -25,11 +25,13 @@ def import_calendar(calendar): events = {} for event in cal.walk("vevent"): 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() start = event.decoded("dtstart").astimezone(timezone.utc) end = event.decoded("dtend").astimezone(timezone.utc) location = event.decoded("location", None) + if not summary: + continue if location is not None: location = location.decode()