aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-05-28 02:31:14 +0200
committerdec05eba <dec05eba@protonmail.com>2020-05-28 02:31:14 +0200
commitfe20f4e3ce6cc194919d13460c741369d5b30c3c (patch)
tree1fcad895f2e4ddf71828dd530cb3562946ca78a6 /src
parent9799803529c57930a0e7f12e45cbcf2b2e4419eb (diff)
Fix chapters not int
Diffstat (limited to 'src')
-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();