Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d10ab13c authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

Fix remove 'en' URL results from wikidata

Refs: #53
parent d2ef9c64
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -202,7 +202,8 @@ def get_results(attribute_result, attributes, language):
                for url in value.split(', '):
                for url in value.split(', '):
                    infobox_urls.append({'title': attribute.get_label(language), 'url': url, **attribute.kwargs})
                    infobox_urls.append({'title': attribute.get_label(language), 'url': url, **attribute.kwargs})
                    # "normal" results (not infobox) include official website and Wikipedia links.
                    # "normal" results (not infobox) include official website and Wikipedia links.
                    if attribute.kwargs.get('official') or attribute_type == WDArticle:
                    if attribute.kwargs.get('official') \
                            or (attribute_type == WDArticle and attribute.language == language):
                        results.append({'title': infobox_title, 'url': url})
                        results.append({'title': infobox_title, 'url': url})
                    # update the infobox_id with the wikipedia URL
                    # update the infobox_id with the wikipedia URL
                    # first the local wikipedia URL, and as fallback the english wikipedia URL
                    # first the local wikipedia URL, and as fallback the english wikipedia URL