Skip to content

Commit

Permalink
ical V
Browse files Browse the repository at this point in the history
(cherry picked from commit 63a0066)
  • Loading branch information
Belissimo-T committed Aug 2, 2024
1 parent b4d7e90 commit 05e6934
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions endpoints/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,16 @@ def generate_html_list(elements: list[str]) -> str:
)

calendar = icalendar.Calendar()
calendar.add("x-wr-calname", f"{fav['name']} (vplan.fr)")
calendar.add("x-wr-caldesc", description)
calendar.add("x-wr-timezone", "Europe/Berlin")
calendar.add("prodid", "-//VPlan FR//vplan.fr//DE")
# calendar.add("x-wr-calname", f"{fav['name']} (vplan.fr)")
# calendar.add("x-wr-caldesc", description)
# calendar.add("x-wr-timezone", "Europe/Berlin")
calendar.add("prodid", "-//github.com/allenporter/ical//8.1.1//EN")
calendar.add("version", "2.0")
calendar.add("method", "PUBLISH")
calendar.add("calscale", "GREGORIAN")
# calendar.add("method", "PUBLISH")
# calendar.add("calscale", "GREGORIAN")

today = datetime.date.today()
for date in cache.get_days():
break
if date < today:
continue

Expand All @@ -231,16 +230,19 @@ def generate_html_list(elements: list[str]) -> str:
subject = lesson["current_class"] if lesson["current_class"] is not None else "-"
teacher = ", ".join(lesson["current_teachers"]) if lesson["current_teachers"] else "-"

subject = subject if not lesson["subject_changed"] else f"[{subject}]"
teacher = teacher if not lesson["teacher_changed"] else f"[{teacher}]"
# subject = subject if not lesson["subject_changed"] else f"[{subject}]"
# teacher = teacher if not lesson["teacher_changed"] else f"[{teacher}]"

summary = f"{subject} {teacher}"
else:
scheduled_subject = lesson["scheduled_class"] if lesson["scheduled_class"] is not None else "-"
scheduled_teacher = ", ".join(lesson["scheduled_teachers"]) if lesson["scheduled_teachers"] else "-"

# summary = (
# f"({scheduled_subject} {scheduled_teacher})"
# )
summary = (
f"({scheduled_subject} {scheduled_teacher})"
f"{scheduled_subject} {scheduled_teacher}"
)

info_paragraphs = []
Expand Down

0 comments on commit 05e6934

Please sign in to comment.