From c4b5ca023f7f5e6ced71c1dfbb8ee3cf776a6b53 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 6 Aug 2020 07:16:06 +0200 Subject: mangadex: Do not list chapters that are not released yet --- src/plugins/Mangadex.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/Mangadex.cpp') 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") -- cgit v1.2.3