Skip to content

Commit cee4ad4

Browse files
authored
Merge pull request #34 from filips123/fix-lunch-updater
2 parents c225585 + cc004dc commit cee4ad4

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

API/gimvicurnik/updaters/eclassroom.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,13 @@ def _parse_daily_lunch_schedule(self, date, tables):
533533
if "Dijaki prihajate v jedilnico" in table[0][0]:
534534
continue
535535

536-
for row in table:
536+
for index, row in enumerate(table):
537+
# Handle multiple times in the same cell
538+
times = row[0].split("\n", 1)
539+
if len(times) == 2:
540+
row[0] = times[0]
541+
table[index + 1][0] = times[1]
542+
537543
# Skip header
538544
if row[0] and "ura" in row[0]:
539545
continue

API/gimvicurnik/utils/ical.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def create_school_calendar(details, timetables, hours, name, timetable=True, sub
3232
calendar.add("X-PUBLISHED-TTL", vDuration(timedelta(hours=1)))
3333
calendar.add("REFRESH-INTERVAL", vDuration(timedelta(hours=1)))
3434

35-
year = datetime.now().year if datetime.now().date() > date(datetime.now().year, 9, 1) else datetime.now().year - 1
35+
year = datetime.now().year if datetime.now().date() >= date(datetime.now().year, 9, 1) else datetime.now().year - 1
3636

3737
weekdays = ["SU", "MO", "TU", "WE", "TH", "FR", "SA"]
3838
weektable = [[None for i in range(10)] for j in range(6)]
@@ -146,8 +146,8 @@ def create_schedule_calendar(query, name):
146146
calendar.add("X-WR-CALNAME", name)
147147
calendar.add("X-WR-CALDESC", name)
148148
calendar.add("NAME", name)
149-
calendar.add("X-PUBLISHED-TTL", vDuration(timedelta(hours=12)))
150-
calendar.add("REFRESH-INTERVAL", vDuration(timedelta(hours=12)))
149+
calendar.add("X-PUBLISHED-TTL", vDuration(timedelta(hours=1)))
150+
calendar.add("REFRESH-INTERVAL", vDuration(timedelta(hours=1)))
151151

152152
for model in query:
153153
with start_span(op="event") as span:

website/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="alternate" type="application/atom+xml" title="Okrožnice - Gimnazija Vič" href="<%= VUE_APP_API %>/feeds/circulars.atom" />
1414
<link rel="alternate" type="application/atom+xml" title="Nadomeščanja - Gimnazija Vič" href="<%= VUE_APP_API %>/feeds/substitutions.atom" />
1515
<link rel="alternate" type="application/atom+xml" title="Jedilniki - Gimnazija Vič" href="<%= VUE_APP_API %>/feeds/menus.atom" />
16-
<link rel="alternate" type="application/atom+xml" title="Razporedi kosil - Gimnazija Vič" href="<%= VUE_APP_API %>/feeds/schedules.atom" />
16+
<link rel="alternate" type="application/atom+xml" title="Razporedi delitve kosila - Gimnazija Vič" href="<%= VUE_APP_API %>/feeds/schedules.atom" />
1717

1818
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
1919
</head>

0 commit comments

Comments
 (0)