forked from Anri/cal8tor
fix for 2022-2023 semester 1
This commit is contained in:
parent
8b6daaab3a
commit
fb21d3eece
1 changed files with 4 additions and 6 deletions
|
@ -50,6 +50,7 @@ pub async fn timetable(
|
||||||
|
|
||||||
// For each days
|
// For each days
|
||||||
let mut timetable = Vec::new();
|
let mut timetable = Vec::new();
|
||||||
|
let span_regex = Regex::new(r"<span.*</span>").unwrap();
|
||||||
for day in raw_timetable_values.select(&sel_tr) {
|
for day in raw_timetable_values.select(&sel_tr) {
|
||||||
let mut courses_vec = Vec::new();
|
let mut courses_vec = Vec::new();
|
||||||
let mut location_tracker = 0;
|
let mut location_tracker = 0;
|
||||||
|
@ -60,12 +61,9 @@ pub async fn timetable(
|
||||||
} else {
|
} else {
|
||||||
courses_vec.push(Some(models::Course {
|
courses_vec.push(Some(models::Course {
|
||||||
name: match course.select(&sel_em).next() {
|
name: match course.select(&sel_em).next() {
|
||||||
Some(value) => value.inner_html(),
|
Some(value) => span_regex.replace(&value.inner_html(), " ").to_string(),
|
||||||
None => course
|
None => span_regex
|
||||||
.inner_html()
|
.replace(course.inner_html().split("<br>").next().unwrap(), " ")
|
||||||
.split("<br>")
|
|
||||||
.next()
|
|
||||||
.unwrap()
|
|
||||||
.to_string(),
|
.to_string(),
|
||||||
},
|
},
|
||||||
professor: match course
|
professor: match course
|
||||||
|
|
Reference in a new issue