Merge branch 'main' of http://gitea.xxhhcty.xyz:8080/zcdsj/paper_server
This commit is contained in:
commit
76bb3bb4d4
|
|
@ -403,9 +403,9 @@ def download_pdf(paper_id):
|
||||||
if paper.has_fulltext_pdf is False and paper.publication_year <= 2021:
|
if paper.has_fulltext_pdf is False and paper.publication_year <= 2021:
|
||||||
current_from = "scihub"
|
current_from = "scihub"
|
||||||
msg = save_pdf_from_scihub(paper)
|
msg = save_pdf_from_scihub(paper)
|
||||||
if paper.has_fulltext_pdf is False and cache.get("openalex_api_exceed") is None:
|
# if paper.has_fulltext_pdf is False and cache.get("openalex_api_exceed") is None:
|
||||||
current_from = "openalex"
|
# current_from = "openalex"
|
||||||
msg = save_pdf_from_openalex(paper)
|
# msg = save_pdf_from_openalex(paper)
|
||||||
if paper.fail_reason is None and paper.has_fulltext_pdf is False:
|
if paper.fail_reason is None and paper.has_fulltext_pdf is False:
|
||||||
paper.save_fail_reason(msg)
|
paper.save_fail_reason(msg)
|
||||||
return msg, current_from
|
return msg, current_from
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class PaperViewSet(CustomGenericViewSet, CustomListModelMixin):
|
||||||
queryset = Paper.objects.all()
|
queryset = Paper.objects.all()
|
||||||
serializer_class = PaperListSerializer
|
serializer_class = PaperListSerializer
|
||||||
filterset_fields = ["publication_year", "type", "fetch_status",
|
filterset_fields = ["publication_year", "type", "fetch_status",
|
||||||
"has_abstract", "has_fulltext"]
|
"has_abstract", "has_fulltext", "doi"]
|
||||||
search_fields = ['title', 'first_author', 'first_author_institution']
|
search_fields = ['title', 'first_author', 'first_author_institution']
|
||||||
ordering = ["-publication_date", "-create_time"]
|
ordering = ["-publication_date", "-create_time"]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue