From 196454648a015112f5d80fed1190dfcbe05e4edd Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 29 Jan 2026 18:26:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9A=82=E6=97=B6=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E4=BB=8Esave=5Fpdf=5Ffrom=5Fopenalex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/resm/tasks.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/resm/tasks.py b/apps/resm/tasks.py index 5d9a11d..5346ca1 100644 --- a/apps/resm/tasks.py +++ b/apps/resm/tasks.py @@ -317,12 +317,13 @@ def download_pdf(paper_id): # 将状态改为downloading paper.fetch_status = 'downloading' paper.save(update_fields=['fetch_status', 'update_time']) - - current_from = "oa_url" - msg = save_pdf_from_oa_url(paper) - if paper.has_fulltext_pdf is False: - current_from = "openalex" - msg = save_pdf_from_openalex(paper) + msg = "没有下载渠道" + if paper.oa_url: + current_from = "oa_url" + msg = save_pdf_from_oa_url(paper) + # if paper.has_fulltext_pdf is False and cache.get("openalex_api_exceed") is None: + # current_from = "openalex" + # msg = save_pdf_from_openalex(paper) return msg, current_from finally: if paper.fetch_status == "downloading":