From fe20f4e3ce6cc194919d13460c741369d5b30c3c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 28 May 2020 02:31:14 +0200 Subject: Fix chapters not int --- src/plugins/Mangadex.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/Mangadex.cpp b/src/plugins/Mangadex.cpp index 43368af..1d1730a 100644 --- a/src/plugins/Mangadex.cpp +++ b/src/plugins/Mangadex.cpp @@ -163,7 +163,7 @@ namespace QuickMedia { return a_timestamp > b_timestamp; }); - int prev_chapter_number = -1; + std::string prev_chapter_number; for(auto it = chapters.begin(); it != chapters.end(); ++it) { const std::string &chapter_id = it->first; Json::Value &chapter = it->second; @@ -177,14 +177,14 @@ namespace QuickMedia { if(!chapter_number_json.isString()) continue; - int chapter_number = atoi(chapter_number_json.asCString()); - if(chapter_number == 0 || chapter_number == prev_chapter_number) + std::string chapter_number_str = chapter_number_json.asString(); + if(chapter_number_str == prev_chapter_number) continue; - prev_chapter_number = chapter_number; + prev_chapter_number = chapter_number_str; Json::Value &chapter_title_json = chapter["title"]; std::string chapter_url = mangadex_url + "/chapter/" + chapter_id; - std::string chapter_name = std::string("Ch. ") + chapter_number_json.asCString(); + std::string chapter_name = std::string("Ch. ") + chapter_number_str; if(chapter_title_json.isString()) chapter_name += std::string(" - ") + chapter_title_json.asCString(); -- cgit v1.2.3