s
This commit is contained in:
parent
5499904cef
commit
1c01b29be7
31 changed files with 1725 additions and 53 deletions
|
|
@ -58,6 +58,7 @@ def _serialize_pdf_queue_item(item) -> dict[str, object]:
|
|||
"publication_id": item.publication_id,
|
||||
"title": item.title,
|
||||
"doi": item.doi,
|
||||
"display_identifier": _serialize_display_identifier(item.display_identifier),
|
||||
"pdf_url": item.pdf_url,
|
||||
"status": item.status,
|
||||
"attempt_count": item.attempt_count,
|
||||
|
|
@ -73,6 +74,18 @@ def _serialize_pdf_queue_item(item) -> dict[str, object]:
|
|||
}
|
||||
|
||||
|
||||
def _serialize_display_identifier(value) -> dict[str, object] | None:
|
||||
if value is None:
|
||||
return None
|
||||
return {
|
||||
"kind": value.kind,
|
||||
"value": value.value,
|
||||
"label": value.label,
|
||||
"url": value.url,
|
||||
"confidence_score": float(value.confidence_score),
|
||||
}
|
||||
|
||||
|
||||
def _requeue_response_state(*, queued: bool) -> tuple[str, str]:
|
||||
if queued:
|
||||
return "queued", "PDF lookup queued."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue