Skip to content

Commit

Permalink
workaround for CaDu mangling data on Verfahren page ("Prüfungsart: MP…
Browse files Browse the repository at this point in the history
…MAPrüfungstermin:")
  • Loading branch information
greybaron committed Aug 13, 2024
1 parent 134721a commit 5c9d7e3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/campus_backend/req_client_funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,14 @@ pub async fn extract_exam_verfahren_options(
}

let signup_information_messy = main_subline_texts.next().unwrap().trim_start();
let signup_information =
if let Some(stripped) = signup_information_messy.strip_suffix(", Prüfungstermin: ") {
stripped
} else {
signup_information_messy
}
.to_string();
let signup_information = if let Some(stripped) = signup_information_messy
.split_once("Prüfungstermin")
.map(|split| split.0.replace(", ", ""))
{
stripped
} else {
signup_information_messy.to_string()
};

let exam_date = main_subline_texts.next().map(|el| el.to_string());
let exam_time = main_subline_texts.nth(1).map(|el| el.to_string());
Expand Down

0 comments on commit 5c9d7e3

Please sign in to comment.