From 779b596d634b42827c7a05b11309218d3afcab58 Mon Sep 17 00:00:00 2001 From: powe97 <116031952+powe97@users.noreply.github.com> Date: Thu, 27 Jul 2023 18:12:44 -0400 Subject: [PATCH] IHSS -> INQR (why) --- src/GenerateHtml.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/GenerateHtml.cpp b/src/GenerateHtml.cpp index 8379164..f8427ee 100644 --- a/src/GenerateHtml.cpp +++ b/src/GenerateHtml.cpp @@ -165,6 +165,8 @@ std::string fix_course_ids(std::string course) { course[3] = 'O'; } else if(course.substr(0,4) == "ITEC") { course.replace(0,4,"ITWS"); + } else if(course.substr(0,4) == "IHSS") { + course.replace(0,4,"INQR"); } return course; } @@ -221,6 +223,19 @@ Json::Value get_data(const Json::Value& data, out[key] = itws[key]; if(out[key].isObject()) out[key]["prefix"] = "ITWS"; } + } else if(course_id.substr(0,4) == "INQR") { + const auto& inqr = data[course_id]; + course_id.replace(0,4,"IHSS"); + const auto& ihss = data[course_id]; + + for(const auto& key : inqr.getMemberNames()) { + out[key] = inqr[key]; + if(out[key].isObject()) out[key]["prefix"] = "INQR"; + } + for(const auto& key : ihss.getMemberNames()) { + out[key] = ihss[key]; + if(out[key].isObject()) out[key]["prefix"] = "IHSS"; + } } else { out = data[course_id]; for(const auto& key : out.getMemberNames()) {