diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-08-06 07:16:06 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-06 07:16:06 +0200 |
commit | c4b5ca023f7f5e6ced71c1dfbb8ee3cf776a6b53 (patch) | |
tree | 8b1c8f8be6d5df1e1735d2df098176c58498446f | |
parent | b486665e9470ff3477c97a70e7982dd587b4c7d6 (diff) |
mangadex: Do not list chapters that are not released yet
-rw-r--r-- | src/plugins/Mangadex.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/Mangadex.cpp b/src/plugins/Mangadex.cpp index b3c5e36..d2dee13 100644 --- a/src/plugins/Mangadex.cpp +++ b/src/plugins/Mangadex.cpp @@ -79,11 +79,17 @@ namespace QuickMedia { return a_timestamp > b_timestamp; }); + time_t time_now = time(NULL); + 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; + Json::Value ×tamp_json = chapter["timestamp"]; + if(timestamp_json.isInt64() && timestamp_json.asInt64() > time_now) + continue; + Json::Value &lang_code = chapter["lang_code"]; // TODO: Allow selecting other languages than english if(!lang_code.isString() || lang_code.asString() != "gb") |