From a44289aef22edb067198fedb5e51877400679702 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 12 May 2021 20:03:36 +0200 Subject: Skip duplicate chapters (different translators) --- src/plugins/Mangadex.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugins/Mangadex.cpp') 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') -- cgit v1.2.3