Return (download_base_url, metadata_base_url) from a manifest dict. Both fields fall back to root_url when not set. All base URL fields are optional; callers must guard against empty strings before building URLs.
(manifest: dict)
| 336 | |
| 337 | |
| 338 | def _resolve_manifest_base_urls(manifest: dict) -> tuple[str, str]: |
| 339 | """Return (download_base_url, metadata_base_url) from a manifest dict. |
| 340 | |
| 341 | Both fields fall back to root_url when not set. All base URL fields are |
| 342 | optional; callers must guard against empty strings before building URLs. |
| 343 | """ |
| 344 | root_url = manifest.get("root_url", "").rstrip("/") |
| 345 | download_base_url = manifest.get("download_base_url", "").rstrip("/") or root_url |
| 346 | metadata_base_url = manifest.get("metadata_base_url", "").rstrip("/") or root_url |
| 347 | return download_base_url, metadata_base_url |
| 348 | |
| 349 | |
| 350 | def _invalidate_plugin_detail_cache(repo_id, manifest_data): |
no test coverage detected