1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-19 19:00:10 +01:00

Merge pull request #1811 from return42/fix-paper.html

[fix] doc of the paper.html template (isbn, issn)
This commit is contained in:
Alexandre Flament 2022-09-28 09:19:20 +02:00 committed by GitHub
commit 7097508a67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -386,11 +386,11 @@ the parameter ``template`` must be set to the desired type.
- DOI number (like ``10.1038/d41586-018-07848-2``)
* - issn
- :py:class:`str`
- :py:class:`List <list>`\ [\ :py:class:`str`\ ]
- ISSN number like ``1476-4687``
* - isbn
- :py:class:`str`
- :py:class:`List <list>`\ [\ :py:class:`str`\ ]
- ISBN number like ``9780201896831``
* - pdf_url

View File

@ -77,6 +77,7 @@ def response(resp):
if url is None:
continue
publishedDate = None
time = source['publishedDate'] or source['depositedDate']
if time:
publishedDate = datetime.fromtimestamp(time / 1000)
@ -106,8 +107,8 @@ def response(resp):
# 'pages' : '',
# 'number': '',
'doi': source['doi'],
'issn': source['issn'],
'isbn': source.get('isbn'), # exists in the rawRecordXml
'issn': [x for x in [source.get('issn')] if x],
'isbn': [x for x in [source.get('isbn')] if x], # exists in the rawRecordXml
'pdf_url': source.get('repositoryDocument', {}).get('pdfOrigin'),
}
)