MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _resolve_manifest_base_urls

Function _resolve_manifest_base_urls

apps/plugins/api_views.py:338–347  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

336
337
338def _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
350def _invalidate_plugin_detail_cache(repo_id, manifest_data):

Callers 3

getMethod · 0.85
postMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected