diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-05-12 20:03:36 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-05-12 20:03:36 +0200 |
commit | a44289aef22edb067198fedb5e51877400679702 (patch) | |
tree | a5e19683d08e103422b42b4a3445f4e2b0a3ae18 /src | |
parent | 34cdb1189d8a11fe1deb1189d86c5c77b33c7653 (diff) |
Skip duplicate chapters (different translators)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/Mangadex.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/Mangadex.cpp b/src/plugins/Mangadex.cpp index a402bb2..48ab23f 100644 --- a/src/plugins/Mangadex.cpp +++ b/src/plugins/Mangadex.cpp @@ -138,6 +138,7 @@ namespace QuickMedia { if(!results_json.isArray()) return PluginResult::OK; + const char *prev_chapter = nullptr; for(const Json::Value &result_item_json : results_json) { if(!result_item_json.isObject()) continue; @@ -166,6 +167,10 @@ namespace QuickMedia { if(!chapter_json.isString()) continue; + if(prev_chapter && strcmp(prev_chapter, chapter_json.asCString()) == 0) + continue; + + prev_chapter = chapter_json.asCString(); std::string title = "Ch. " + chapter_json.asString(); const Json::Value &title_json = attributes_json["title"]; if(title_json.isString() && title_json.asCString()[0] != '\0') |