Ignore romaji versions of tags
This commit is contained in:
parent
a448dd9b6e
commit
b71cbd039d
|
@ -81,9 +81,6 @@ void from_json(const nlohmann::json& j, User& user) {
|
||||||
|
|
||||||
void from_json(const nlohmann::json& j, Tag& tag) {
|
void from_json(const nlohmann::json& j, Tag& tag) {
|
||||||
j.at("tag").get_to(tag.japanese);
|
j.at("tag").get_to(tag.japanese);
|
||||||
if (j.contains("romaji")) {
|
|
||||||
tag.romaji = j["romaji"].get<std::string>();
|
|
||||||
}
|
|
||||||
if (j.contains("translation")) {
|
if (j.contains("translation")) {
|
||||||
tag.english = j["translation"].get<std::string>();
|
tag.english = j["translation"].get<std::string>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@ struct User {
|
||||||
|
|
||||||
struct Tag {
|
struct Tag {
|
||||||
std::string japanese;
|
std::string japanese;
|
||||||
std::optional<std::string> romaji;
|
|
||||||
std::optional<std::string> english;
|
std::optional<std::string> english;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,6 @@ static inline Element generate_illust_tags(const Illust& illust) {
|
||||||
for (const Tag& i : illust.tags) {
|
for (const Tag& i : illust.tags) {
|
||||||
std::string tag = [&]() {
|
std::string tag = [&]() {
|
||||||
if (i.english) return *i.english;
|
if (i.english) return *i.english;
|
||||||
if (i.romaji) return *i.romaji;
|
|
||||||
return i.japanese;
|
return i.japanese;
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue