aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-08-06 07:12:45 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-06 07:12:45 +0200
commit41ac3fe0e8d89be22f0e0e6f9db8accd25a99573 (patch)
tree09aa206c9098275f78cc44be80a33e94c10ddc32
parentea7bc817764f343192ef44c9d1a78335eca3ec12 (diff)
mangadex: Do not list chapters that are not released yet
-rwxr-xr-xplugins/mangadex.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/mangadex.py b/plugins/mangadex.py
index 08e85b5..59956a4 100755
--- a/plugins/mangadex.py
+++ b/plugins/mangadex.py
@@ -99,6 +99,7 @@ def list_chapters(url, chapter_list_input):
for key, value in chapter_json.items():
chapters.append((key, value))
+ time_now = time.time()
chapters = sorted(chapters, key=chapter_sort_func, reverse=True)
prev_chapter_number = ""
output_chapters = []
@@ -106,6 +107,10 @@ def list_chapters(url, chapter_list_input):
chapter_id = chapter_data[0]
chapter = chapter_data[1]
+ timestamp = chapter.get("timestamp", 0)
+ if timestamp > time_now:
+ continue
+
lang_code = chapter.get("lang_code", "")
if lang_code != lang:
continue