Skip to content

Commit 0b97b83

Browse files
authored
Merge pull request #36 from filips123/fix-lunch-schedule-and-menu-updaters
2 parents 7748cdb + 425987a commit 0b97b83

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

API/gimvicurnik/updaters/eclassroom.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@ def _parse_daily_lunch_schedule(self, date, tables):
540540
row[0] = times[0]
541541
table[index + 1][0] = times[1]
542542

543+
# Handle different time formats
544+
row[0] = row[0].strip().replace(".", ":")
545+
543546
# Skip header
544547
if row[0] and "ura" in row[0]:
545548
continue
@@ -549,7 +552,7 @@ def _parse_daily_lunch_schedule(self, date, tables):
549552
continue
550553

551554
is_time_valid = row[0] and row[0].strip() != "do"
552-
time = datetime.datetime.strptime(row[0].strip(), "%H:%M").time() if is_time_valid else last_hour
555+
time = datetime.datetime.strptime(row[0], "%H:%M").time() if is_time_valid else last_hour
553556
last_hour = time
554557

555558
notes = row[1].strip() if row[0] else last_notes

API/gimvicurnik/updaters/menu.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ def _store_snack_menu(self, url, date, span):
178178

179179
# Parse tables into menus and store them
180180
for table in tables:
181-
for row in table[1::2]:
181+
for row in table:
182+
if "NV in N" in row[1]:
183+
continue
184+
182185
current = date + datetime.timedelta(days=days)
183186
days += 1
184187

@@ -328,7 +331,10 @@ def _store_lunch_menu(self, url, date, span):
328331

329332
# Parse tables into menus and store them
330333
for table in tables:
331-
for row in table[1::2]:
334+
for row in table:
335+
if "N KOSILO" in row[1]:
336+
continue
337+
332338
current = date + datetime.timedelta(days=days)
333339
days += 1
334340

0 commit comments

Comments
 (0)