continuing refactor

This commit is contained in:
2026-05-03 21:20:05 -07:00
parent 77cab1bd27
commit 5534812426
50 changed files with 1004 additions and 428 deletions
+26 -2
View File
@@ -74,8 +74,32 @@ def ping_url(url: str, timeout: float = 3.0) -> tuple[bool, str]:
def provider_display_name(key: str) -> str:
label = (key or "").strip()
return label[:1].upper() + label[1:] if label else "Plugin"
label = (key or "").strip().lower()
if not label:
return "Plugin"
# Preserve expected brand casing for common providers.
display_overrides = {
"youtube": "YouTube",
"openlibrary": "OpenLibrary",
"podcastindex": "PodcastIndex",
}
if label in display_overrides:
return display_overrides[label]
return label[:1].upper() + label[1:]
def default_provider_ping_targets(key: str) -> list[str]:
"""Return default health-check URLs for known providers."""
label = (key or "").strip().lower()
defaults = {
"bandcamp": ["https://bandcamp.com"],
"youtube": ["https://www.youtube.com"],
"openlibrary": ["https://openlibrary.org"],
"podcastindex": ["https://podcastindex.org"],
"loc": ["https://www.loc.gov"],
}
return list(defaults.get(label, []))
def ping_first(urls: list[str]) -> tuple[bool, str]: