diff --git a/backend/cache.py b/backend/cache.py
index b3df9c66..b6d6c99d 100644
--- a/backend/cache.py
+++ b/backend/cache.py
@@ -56,23 +56,22 @@ def get_plan_file(self,
"""Return the contents of a plan file from the cache."""
# self._logger.debug(f"get_plan_file({day!r}, {timestamp!r}, {filename!r})")
- if newest_before:
+ if newest_before and not isinstance(timestamp, str):
timestamps = self.get_timestamps(day)
- if not isinstance(timestamp, str):
- timestamps = [t for t in timestamps if t <= timestamp]
+ timestamps = [t for t in timestamps if t <= timestamp]
- for timestamp in timestamps:
+ for older_timestamp in timestamps:
try:
- return self.get_plan_file(day, timestamp, filename, newest_before=False)
+ return self.get_plan_file(day, older_timestamp, filename, newest_before=False)
except OSError:
pass
else:
raise FileNotFoundError
+ else:
+ path = self.get_plan_path(day, timestamp) / filename
- path = self.get_plan_path(day, timestamp) / filename
-
- with open(path, "r", encoding="utf-8") as f:
- return f.read()
+ with open(path, "r", encoding="utf-8") as f:
+ return f.read()
def store_meta_file(self, content: str, filename: str):
"""Store a meta file in the cache such as "meta.json"."""
diff --git a/backend/meta_extractor.py b/backend/meta_extractor.py
index ceea89fa..883a7f86 100644
--- a/backend/meta_extractor.py
+++ b/backend/meta_extractor.py
@@ -90,9 +90,6 @@ def iterate_daily_extractors(self) -> typing.Generator[DailyMetaExtractor, None,
try:
plan_kl = self.cache.get_plan_file(day, timestamp, "PlanKl.xml")
except FileNotFoundError:
- self._logger.warning(
- f"Timestamp {timestamp!s} for day {day!s} has no PlanKl.xml file."
- )
continue
extractor = DailyMetaExtractor(plan_kl)
diff --git a/backend/plan_processor.py b/backend/plan_processor.py
index 53a0bda5..8f2f4bcd 100644
--- a/backend/plan_processor.py
+++ b/backend/plan_processor.py
@@ -14,7 +14,7 @@
class PlanProcessor:
- VERSION = "74"
+ VERSION = "75"
def __init__(self, cache: Cache, school_number: str, *, logger: logging.Logger):
self._logger = logger
@@ -67,7 +67,7 @@ def compute_plans(self, date: datetime.date, timestamp: datetime.datetime):
self._logger.warning(f"=> Could not find Indiware form plan for date {date!s} and timestamp {timestamp!s}.")
else:
try:
- vplan_kl = self.cache.get_plan_file(date, timestamp, "VPlanKl.xml", newest_before=True)
+ vplan_kl = self.cache.get_plan_file(date, timestamp, "VplanKl.xml", newest_before=True)
except FileNotFoundError:
vplan_kl = None
plan_extractor = PlanExtractor(plan_kl, vplan_kl, self.teachers.abbreviation_by_surname(),
diff --git a/backend/vplan_utils.py b/backend/vplan_utils.py
index 82e9557a..555bc95d 100644
--- a/backend/vplan_utils.py
+++ b/backend/vplan_utils.py
@@ -226,13 +226,16 @@ def periods_to_block_label(periods: list[int]) -> str:
def _parse_periods(period_str: str) -> list[int]:
+ def period_str_to_int(string: str) -> int:
+ return int(string.replace("Stunde", "").replace(".", ""))
+
if not period_str:
return []
elif "-" not in period_str:
- return [int(period_str)]
+ return [period_str_to_int(period_str)]
else:
begin, end = period_str.split("-")
- return list(range(int(begin), int(end) + 1))
+ return list(range(period_str_to_int(begin), period_str_to_int(end) + 1))
def parse_periods(period_str: str) -> list[int]:
diff --git a/client/public/base_static/images/school_icons/10000000.png b/client/public/base_static/images/school_icons/10000000.png
new file mode 100644
index 00000000..eeb05014
Binary files /dev/null and b/client/public/base_static/images/school_icons/10000000.png differ
diff --git a/client/src/App.svelte b/client/src/App.svelte
index eab6af9c..5b39e957 100644
--- a/client/src/App.svelte
+++ b/client/src/App.svelte
@@ -35,7 +35,6 @@
let api_base;
let selected_revision;
let meta;
- let all_meta;
let enabled_dates;
let grouped_rooms;
let course_lists;
@@ -62,7 +61,6 @@
api_base = null;
selected_revision = ".newest";
meta = {};
- all_meta = {};
enabled_dates = [];
grouped_rooms = [];
course_lists = {};
@@ -83,8 +81,7 @@
let data = localStorage.getItem(`${school_num}_meta`);
if (data !== "undefined" && data) {
data = JSON.parse(data);
- all_meta = data;
- meta = data.meta;
+ meta = data;
all_rooms = data.rooms;
teacher_list = Object.keys(data.teachers);
grouped_forms = data.forms.grouped_forms;
@@ -105,8 +102,7 @@
throw error;
}
}
- all_meta = data;
- meta = data.meta;
+ meta = data;
all_rooms = data.rooms;
teacher_list = Object.keys(data.teachers);
grouped_forms = data.forms.grouped_forms;
@@ -284,7 +280,7 @@
$: school_num && (api_base = `/api/v69.420/${school_num}`);
$: school_num && reset_plan_vars();
$: school_num && get_meta();
- $: all_revisions = [".newest"].concat((all_meta?.dates || {})[date] || []);
+ $: all_revisions = [".newest"].concat((meta?.dates || {})[date] || []);
$: school_num && get_preferences();
$: all_rooms && (grouped_rooms = group_rooms(all_rooms));
$: $logged_in && get_settings();
@@ -386,7 +382,7 @@
{#if $current_page.substring(0, 4) === "plan"}
-