(push: Optional[Dict[str, Any]])
| 300 | |
| 301 | |
| 302 | def _push_payload(push: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]: |
| 303 | if not push: |
| 304 | return None |
| 305 | papers = list(push.get("papers") or []) |
| 306 | return { |
| 307 | "push_id": push.get("push_id"), |
| 308 | "push_time": push.get("push_time") or push.get("created_at"), |
| 309 | "papers": [_paper_card(paper, index) for index, paper in enumerate(papers, start=1)], |
| 310 | "metadata": dict(push.get("metadata") or {}), |
| 311 | } |
| 312 | |
| 313 | |
| 314 | def _preview_key(paper: Dict[str, Any]) -> str: |
no test coverage detected