diff options
| author | Hunternif <hunternif@gmail.com> | 2022-10-02 05:01:39 +0100 |
|---|---|---|
| committer | Hunternif <hunternif@gmail.com> | 2022-10-02 05:01:39 +0100 |
| commit | eaddfe5ed6c669fab4210025f443efa72ab23748 (patch) | |
| tree | c34f56dc02244e665353cac91273ccbe8c77eb82 | |
| parent | e1ea5f54f5d6b7364e28b34d69bb7862f44a9b04 (diff) | |
server: fix null error in lookalikes for videos
| -rw-r--r-- | server/szurubooru/api/post_api.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/server/szurubooru/api/post_api.py b/server/szurubooru/api/post_api.py index b89a7f6..e5ca037 100644 --- a/server/szurubooru/api/post_api.py +++ b/server/szurubooru/api/post_api.py @@ -330,6 +330,9 @@ def get_posts_lookalikes( threshold = ctx.get_param_as_float("threshold", default=1, min=0, max=100) post_id = _get_post_id(params) post = posts.get_post_by_id(post_id) + if post.signature is None: + return {"similarPosts": []} + sig = image_hash.unpack_signature(post.signature.signature) # limit + 1 because the original post will be excluded lookalikes = posts.search_by_signature(sig, limit + 1, threshold) |