From 593026ad9cd024fd7b3182d48f274aa41b374c74 Mon Sep 17 00:00:00 2001 From: Alexandre FLAMENT Date: Fri, 26 Aug 2022 16:07:38 +0000 Subject: [PATCH] oa_doi_rewrite: add the doi to the result when it is found. Currentty, when oa_doi_rewrite find a DOI in the result URL, it replace the URL. In this commit, the plugin adds the key "doi" to the result, so the paper.html can show it. --- searx/plugins/oa_doi_rewrite.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/searx/plugins/oa_doi_rewrite.py b/searx/plugins/oa_doi_rewrite.py index 54d28bc9a..f0e07735d 100644 --- a/searx/plugins/oa_doi_rewrite.py +++ b/searx/plugins/oa_doi_rewrite.py @@ -42,4 +42,6 @@ def on_result(request, search, result): doi = doi[: -len(suffix)] result['url'] = get_doi_resolver(request.preferences) + doi result['parsed_url'] = urlparse(result['url']) + if 'doi' not in result: + result['doi'] = doi return True