STSS/STSH merger

This commit is contained in:
3eef8a28f26fb2bcc514e6f1938929a1f931762 2023-02-08 23:26:45 -05:00
parent 736defdd0a
commit 3e4be443be
1 changed files with 7 additions and 1 deletions

View File

@ -147,7 +147,13 @@ void handle_course(const Json::Value& course,
const std::string& term,
quatalog_data_t& data,
const Json::Value& term_prereqs) {
const auto& course_code = course["id"].asString();
std::string course_code = course["id"].asString();
// Accounts for STSS/STSH merger. Perhaps not a perfect
// way to do this, but this makes generating the HTML
// much easier
if(course_code.substr(0,3) == "STS") {
course_code[4] = 'O';
}
auto& course_terms = data.terms_offered[course_code];
const Json::Value& sections = course["sections"];
handle_everything(sections,course,term,course_terms,data.prerequisites,term_prereqs);