Fix ical location

This commit is contained in:
Hugo 2024-11-29 19:02:56 +01:00
parent 042e81c66b
commit 86741f4246

View File

@ -107,7 +107,13 @@ def build_ical(events: list[dict]) -> str:
event_template = event_template.replace("<!--DATE-->", date)
event_template = event_template.replace("<!--TITLE-->", title)
event_template = event_template.replace("<!--URL-->", url)
event_template = event_template.replace("<!--LOCATION-->", location)
if location.startswith("DC Krov"):
event_template = event_template.replace("<!--LOCATION-->", "DC Krov\\, Kraljice Marije 47\\, 6\\, Beograd\\, Serbia")
elif location.startswith("Matematički fakultet (Učionica 153)"):
event_template = event_template.replace("<!--LOCATION-->", "Matematički fakultet\\, Svetog Nikole 39\\, Beograd\\, Serbia")
else:
event_template = event_template.replace("<!--LOCATION-->", "")
events_ical += event_template
# Footer