summaryrefslogtreecommitdiff
path: root/searx/engines/wikidata.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-02-06 23:35:55 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-02-06 23:35:55 +0100
commita13c5d70c7b3773afcb2c6bfe684f212b3a70707 (patch)
treefcb3482d375cc4fd58bfc7f7a2763d1df571a707 /searx/engines/wikidata.py
parenta50f32bcfcfce1de94c4eadb646c35489617fba3 (diff)
downloadsearxng-a13c5d70c7b3773afcb2c6bfe684f212b3a70707.tar.gz
searxng-a13c5d70c7b3773afcb2c6bfe684f212b3a70707.zip
[fix] wikidata engine: select image with higher (not lower) priority
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/wikidata.py')
-rw-r--r--searx/engines/wikidata.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py
index 18dac3efb..c6a551e9c 100644
--- a/searx/engines/wikidata.py
+++ b/searx/engines/wikidata.py
@@ -238,7 +238,7 @@ def get_results(attribute_result, attributes, language):
infobox_attributes = []
infobox_content = attribute_result.get('itemDescription', [])
img_src = None
- img_src_priority = 100
+ img_src_priority = 0
for attribute in attributes:
value = attribute.get_str(attribute_result, language)
@@ -264,7 +264,7 @@ def get_results(attribute_result, attributes, language):
# this attribute is an image.
# replace the current image only the priority is lower
# (the infobox contain only one image).
- if attribute.priority < img_src_priority:
+ if attribute.priority > img_src_priority:
img_src = get_thumbnail(value)
img_src_priority = attribute.priority
elif attribute_type == WDGeoAttribute: