server/posts: fix reverse search late evaluation
Uploading webms caused 'Not an image.' error to be shown, cause generators are evaluated lazily, so the `catch` never worked.
This commit is contained in:
parent
accdb51c0b
commit
f828c375e6
1 changed files with 4 additions and 2 deletions
|
@ -553,11 +553,13 @@ def search_by_image_exact(image_content):
|
||||||
|
|
||||||
|
|
||||||
def search_by_image(image_content):
|
def search_by_image(image_content):
|
||||||
|
ret = []
|
||||||
for result in image_hash.search_by_image(image_content):
|
for result in image_hash.search_by_image(image_content):
|
||||||
yield PostLookalike(
|
ret.append(PostLookalike(
|
||||||
score=result.score,
|
score=result.score,
|
||||||
distance=result.distance,
|
distance=result.distance,
|
||||||
post=get_post_by_id(result.path))
|
post=get_post_by_id(result.path)))
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def populate_reverse_search():
|
def populate_reverse_search():
|
||||||
|
|
Loading…
Reference in a new issue