From afe761fac3b6cb5a022597c335354a83c02f2274 Mon Sep 17 00:00:00 2001
From: gouedard2016 <felix.gouedard@ensiie.fr>
Date: Sun, 16 May 2021 11:00:07 +0200
Subject: [PATCH] KAGARI: Add 'newer_than' filter to the arguments

---
 utils/scripts/kagari.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/utils/scripts/kagari.py b/utils/scripts/kagari.py
index 171918de..39492891 100755
--- a/utils/scripts/kagari.py
+++ b/utils/scripts/kagari.py
@@ -99,6 +99,14 @@ def create_parser():
         + "\nmatching the given string. (case insensitive)\n ",
     )
 
+    parser.add_argument(
+        "-n",
+        "--newer-than",
+        dest="newer_than",
+        help='In either mode, filters on the date of uploading,'
+        + "\nreturning files after the date (format YYYY-MM-DD)\n "
+    )
+
     parser.add_argument(
         "-r",
         "--random",
@@ -143,7 +151,8 @@ def search_query(args):
         url_values["id"] = args.id
     # No ID, building the query parameters
     else:
-        for arg_name in ["author", "cat", "type", "search", "random"]:
+        arg_list = ["author", "cat", "type", "search", "random", "newer_than"]
+        for arg_name in arg_list:
             arg = getattr(args, arg_name)
             if arg:
                 url_values[arg_name] = arg
-- 
GitLab