diff options
| author | Alexandre FLAMENT <alexandre.flament@hesge.ch> | 2022-08-26 16:07:38 +0000 |
|---|---|---|
| committer | Alexandre Flament <alex@al-f.net> | 2022-09-23 20:45:58 +0200 |
| commit | 593026ad9cd024fd7b3182d48f274aa41b374c74 (patch) | |
| tree | aa818874e352dd187e98c0725fb0830c1a1eebdb | |
| parent | 5ba831d6a88bca617d984593f6710d0c18bae120 (diff) | |
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.
| -rw-r--r-- | searx/plugins/oa_doi_rewrite.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 |