summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/szurubooru/api/post_api.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/szurubooru/api/post_api.py b/server/szurubooru/api/post_api.py
index 3a35bf8..b89a7f6 100644
--- a/server/szurubooru/api/post_api.py
+++ b/server/szurubooru/api/post_api.py
@@ -331,8 +331,9 @@ def get_posts_lookalikes(
post_id = _get_post_id(params)
post = posts.get_post_by_id(post_id)
sig = image_hash.unpack_signature(post.signature.signature)
- lookalikes = posts.search_by_signature(sig, limit, threshold)
- # exclude the same post:
+ # limit + 1 because the original post will be excluded
+ lookalikes = posts.search_by_signature(sig, limit + 1, threshold)
+ # exclude the original post:
lookalikes = filter(lambda la: la[1].post_id != post_id, lookalikes)
lookalikes = sorted(lookalikes, key=lambda la: la[0])
return {