(plan_item: dict[str, Any])
| 124 | |
| 125 | |
| 126 | def source_image_filename(plan_item: dict[str, Any]) -> str: |
| 127 | candidate = figure_asset_candidate(plan_item) |
| 128 | filename = normalize_whitespace(str(candidate.get("filename", ""))) |
| 129 | if filename: |
| 130 | return filename |
| 131 | path = source_image_path(plan_item) |
| 132 | return path.rsplit("/", 1)[-1] if path else "" |
| 133 | |
| 134 | |
| 135 | def should_insert(caption: dict[str, Any], plan_item: dict[str, Any], status: str) -> bool: |
no test coverage detected