mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 11:31:08 +00:00
Python formatting
This commit is contained in:
parent
9185708224
commit
f0f65b8b73
1 changed files with 5 additions and 3 deletions
|
@ -101,9 +101,11 @@ def search_title_author(query, min_confidence, *filters, return_first=False):
|
||||||
# filter out multiple editions of the same work
|
# filter out multiple editions of the same work
|
||||||
list_results = []
|
list_results = []
|
||||||
for work_id in set(editions_of_work[:30]):
|
for work_id in set(editions_of_work[:30]):
|
||||||
result = results.filter(parent_work=work_id).order_by(
|
result = (
|
||||||
"-rank", "-edition_rank"
|
results.filter(parent_work=work_id)
|
||||||
).first()
|
.order_by("-rank", "-edition_rank")
|
||||||
|
.first()
|
||||||
|
)
|
||||||
|
|
||||||
if return_first:
|
if return_first:
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in a new issue