| 132 | } |
| 133 | |
| 134 | QMultiMap<QString, QString> getAuthors(const QVariant &json_authors) |
| 135 | { |
| 136 | QMultiMap<QString, QString> authors; |
| 137 | |
| 138 | QListIterator<QVariant> it(json_authors.toList()); |
| 139 | QVariantMap resultsValue; |
| 140 | while (it.hasNext()) { |
| 141 | resultsValue = it.next().toMap(); |
| 142 | |
| 143 | QString authorName = resultsValue.value("name").toString(); |
| 144 | |
| 145 | const QStringList roles = resultsValue.value("role").toString().split(","); |
| 146 | for (const auto &role : roles) { |
| 147 | if (role.trimmed() == "writer") |
| 148 | authors.insert("writer", authorName); |
| 149 | else if (role.trimmed() == "inker") |
| 150 | authors.insert("inker", authorName); |
| 151 | else if (role.trimmed() == "penciler" || role.trimmed() == "penciller") |
| 152 | authors.insert("penciller", authorName); |
| 153 | else if (role.trimmed() == "colorist") |
| 154 | authors.insert("colorist", authorName); |
| 155 | else if (role.trimmed() == "letterer") |
| 156 | authors.insert("letterer", authorName); |
| 157 | else if (role.trimmed() == "cover") |
| 158 | authors.insert("cover", authorName); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | return authors; |
| 163 | } |
| 164 | |
| 165 | QPair<QString, QString> getFirstStoryArcIdAndName(const QVariant &json_story_arcs) |
| 166 | { |
no test coverage detected