diff --git a/frontend.py b/frontend.py
index 3215a14..1992817 100644
--- a/frontend.py
+++ b/frontend.py
@@ -126,6 +126,15 @@ def get_jobs():
return jsonify({"jobs": jobs})
+@app.route("/random_jobs", methods=["GET"])
+def random_jobs():
+ # define max number of jobs to fetch from db
+ job_count_limit = 20
+
+ jobs = database.get_random_jobs(limit_count=job_count_limit)
+
+ return jsonify({"jobs": jobs})
+
@app.route("/")
def index():
diff --git a/manage_db.py b/manage_db.py
index 37186c0..969cbc0 100644
--- a/manage_db.py
+++ b/manage_db.py
@@ -132,7 +132,7 @@ def delete_jobs(c, job_uuid="", username=""):
"""Delete the job with the given uuid, or ignore the operation if the uuid does not exist"""
if username:
c.execute(
- "SELECT img, ref_img FROM history WHERE apikey=(SELECT apikey FROM users WHERE username=?)",
+ "SELECT img, ref_img, mask_img FROM history WHERE apikey=(SELECT apikey FROM users WHERE username=?)",
(username,),
)
rows = c.fetchall()
@@ -152,7 +152,7 @@ def delete_jobs(c, job_uuid="", username=""):
print(f"removed {c.rowcount} entries")
elif job_uuid:
c.execute(
- "SELECT img, ref_img FROM history WHERE uuid=?",
+ "SELECT img, ref_img, mask_img FROM history WHERE uuid=?",
(job_uuid,),
)
result = c.fetchone()
diff --git a/templates/index.html b/templates/index.html
index 8921d60..b3a208c 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -39,9 +39,9 @@
data-zh_CN="这张图..">This image is..
-
Describe your image. Example: photo of a cat,
+
Describe your image. Example: photo
+ of a cat,
cute, black and white. Use () to emphasize.