Ignore romaji versions of tags

This commit is contained in:
blankie 2023-05-01 11:23:42 +07:00
parent a448dd9b6e
commit b71cbd039d
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
3 changed files with 0 additions and 5 deletions

View File

@ -81,9 +81,6 @@ void from_json(const nlohmann::json& j, User& user) {
void from_json(const nlohmann::json& j, Tag& tag) {
j.at("tag").get_to(tag.japanese);
if (j.contains("romaji")) {
tag.romaji = j["romaji"].get<std::string>();
}
if (j.contains("translation")) {
tag.english = j["translation"].get<std::string>();
}

View File

@ -27,7 +27,6 @@ struct User {
struct Tag {
std::string japanese;
std::optional<std::string> romaji;
std::optional<std::string> english;
};

View File

@ -171,7 +171,6 @@ static inline Element generate_illust_tags(const Illust& illust) {
for (const Tag& i : illust.tags) {
std::string tag = [&]() {
if (i.english) return *i.english;
if (i.romaji) return *i.romaji;
return i.japanese;
}();