From 52fdeae7528473b7f8a8fc9e4bdb4e6029a0be8a Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Mon, 21 Oct 2024 23:41:08 +0200 Subject: [PATCH] Crawl custom item groups as folders --- CHANGELOG.md | 1 + PFERD/crawl/ilias/kit_ilias_html.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f6e5d0..a755d93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ ambiguous situations. - Support for the course overview page. Using this URL as a target might cause duplication warnings, as subgroups are listed separately. - Support for named capture groups in regex transforms +- Crawl custom item groups as folders ### Fixed - Normalization of meeting names in cards diff --git a/PFERD/crawl/ilias/kit_ilias_html.py b/PFERD/crawl/ilias/kit_ilias_html.py index a3b9459..34e02ba 100644 --- a/PFERD/crawl/ilias/kit_ilias_html.py +++ b/PFERD/crawl/ilias/kit_ilias_html.py @@ -817,11 +817,14 @@ class IliasPage: # ILIAS has proper accordions and weird blocks that look like normal headings, # but some JS later transforms them into an accordion. - # This is for these weird JS-y blocks + # This is for these weird JS-y blocks and custom item groups if "ilContainerItemsContainer" in parent.get("class"): + data_store_url = parent.parent.get("data-store-url", "").lower() + is_custom_item_group = "baseclass=ilcontainerblockpropertiesstoragegui" in data_store_url \ + and "cont_block_id=" in data_store_url # I am currently under the impression that *only* those JS blocks have an # ilNoDisplay class. - if "ilNoDisplay" not in parent.get("class"): + if not is_custom_item_group and "ilNoDisplay" not in parent.get("class"): continue prev: Tag = parent.findPreviousSibling("div") if "ilContainerBlockHeader" in prev.get("class"):