aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Mangadex.cpp10
1 files changed, 5 insertions, 5 deletions
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();