aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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")