-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark.patch
97 lines (93 loc) · 5.67 KB
/
benchmark.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff --git a/src/api/api.cpp b/src/api/api.cpp
index 382e410..fea8ec7 100644
--- a/src/api/api.cpp
+++ b/src/api/api.cpp
@@ -102,7 +102,7 @@ void api::parse_annoucments(const std::string& response, annoucements_t& annoucm
/*.end_date = */annoucment["EndDate"],
/*.subject = */annoucment["Subject"],
/*.content = */annoucment["Content"],
- /*.author = */get_username_by_id(annoucment["AddedBy"]["Id"])
+ /*.author = */""//get_username_by_id(annoucment["AddedBy"]["Id"])
);
}
}
@@ -197,7 +197,7 @@ void api::parse_messages(const std::string& response, api::messages_t& messages_
// Subject and content need to be parsed again because these are double escaped
/*.subject = */json::parse((std::string)message["Subject"]),
/*.content = */json::parse((std::string)message["Body"]),
- /*.author = */fetch_username_by_message_user_id(message["Sender"]["Url"]),
+ /*.author = */"",//fetch_username_by_message_user_id(message["Sender"]["Url"]),
/*.send_date = */message["SendDate"]
);
}
@@ -305,36 +305,36 @@ void api::parse_grades(const std::string& response, grades_t& grades_o) {
json data = json::parse(response);
check_if_target_contains(__FUNCTION__, data, target_data_structure);
- const auto& subjects = get_subjects();
+ //const auto& subjects = get_subjects();
grades_o.reserve(data[target_data_structure].size());
- for(const auto subject : *subjects)
+ /*for(const auto subject : *subjects)
grades_o.emplace(
subject.first,
subject_with_grades_t {
.grades = std::vector<grade_t>(),
.subject = subject.second
}
- );
+ );*/
// Populate
for(const auto& grade : data[target_data_structure].items()) {
- /*grades_o.try_emplace(
+ grades_o.try_emplace(
grade.value()["Subject"]["Id"],
subject_with_grades_t {
.grades = std::vector<grade_t>(),
.subject = ""
}
- );*/
+ );
grades_o[grade.value()["Subject"]["Id"]].grades.emplace_back(
- /*.subject =*/ get_subject_by_id(grade.value()["Subject"]["Id"]),
+ /*.subject =*/ "",//get_subject_by_id(grade.value()["Subject"]["Id"]),
/*.grade =*/ grade.value()["Grade"],
- /*.category =*/ get_category_by_id(grade.value()["Category"]["Id"], GRADE),
- /*.added_by =*/ get_username_by_id(grade.value()["AddedBy"]["Id"]),
+ /*.category =*/ "",//get_category_by_id(grade.value()["Category"]["Id"], GRADE),
+ /*.added_by =*/ "",//get_username_by_id(grade.value()["AddedBy"]["Id"]),
/*.date =*/ grade.value()["Date"],
// Why would a grade have multiple comments
- /*.comment =*/ grade.value().contains("Comments") ? get_comment_by_id(grade.value()["Comments"][0]["Id"]) : "N/A",
+ /*.comment =*/ "", //grade.value().contains("Comments") ? get_comment_by_id(grade.value()["Comments"][0]["Id"]) : "N/A",
/*.semester =*/ grade.value()["Semester"],
/*.is_semester =*/ grade.value()["IsSemester"],
/*.is_semester_proposition =*/ grade.value()["IsSemesterProposition"],
@@ -363,12 +363,12 @@ void api::parse_recent_grades(const std::string& response, recent_grades_t& grad
for(int i = data[target_data_structure].size() - 1; i >= 0; i--) {
const auto& grade = data[target_data_structure].at(i);
grades_o.emplace_back(
- /*.subject =*/ get_subject_by_id(grade["Subject"]["Id"]),
+ /*.subject =*/ "", //get_subject_by_id(grade["Subject"]["Id"]),
/*.grade =*/ grade["Grade"],
- /*.category =*/ get_category_by_id(grade["Category"]["Id"], GRADE),
- /*.added_by =*/ get_username_by_id(grade["AddedBy"]["Id"]),
+ /*.category =*/ "", //get_category_by_id(grade["Category"]["Id"], GRADE),
+ /*.added_by =*/ "", //get_username_by_id(grade["AddedBy"]["Id"]),
/*.date =*/ grade["Date"],
- /*.comment =*/ grade.contains("Comments") ? get_comment_by_id(grade["Comments"][0]["Id"]) : "N/A",
+ /*.comment =*/ "", //grade.contains("Comments") ? get_comment_by_id(grade["Comments"][0]["Id"]) : "N/A",
/*.semester =*/ grade["Semester"],
/*.is_semester =*/ grade["IsSemester"],
/*.is_semester_proposition =*/ grade["IsSemesterProposition"],
@@ -403,9 +403,9 @@ void api::parse_events(const std::string& response, api::events_t& events_o) {
events_o.try_emplace(date, std::vector<event_t>());
events_o.at(date).emplace_back(
/*.description = */ event["Content"],
- /*.category = */ get_category_by_id(event["Category"]["Id"], EVENT),
+ /*.category = */ "", //get_category_by_id(event["Category"]["Id"], EVENT),
/*.date = */ event["Date"],
- /*.created_by = */ get_username_by_id(event["CreatedBy"]["Id"]),
+ /*.created_by = */ "", //get_username_by_id(event["CreatedBy"]["Id"]),
/*.lesson_offset = */ event["LessonNo"].is_null() ? 0 : std::stoi((std::string)event["LessonNo"])
);
}