aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-08-06 07:16:06 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-06 07:16:06 +0200
commitc4b5ca023f7f5e6ced71c1dfbb8ee3cf776a6b53 (patch)
tree8b1c8f8be6d5df1e1735d2df098176c58498446f
parentb486665e9470ff3477c97a70e7982dd587b4c7d6 (diff)
mangadex: Do not list chapters that are not released yet
-rw-r--r--src/plugins/Mangadex.cpp6
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 &timestamp_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")