(for providerID: String)
| 1567 | // MARK: - Provider Management Functions |
| 1568 | |
| 1569 | private func providerKey(for providerID: String) -> String { |
| 1570 | let trimmed = providerID.trimmingCharacters(in: .whitespacesAndNewlines) |
| 1571 | guard !trimmed.isEmpty else { return "" } |
| 1572 | |
| 1573 | // Built-in providers use their ID directly |
| 1574 | if ModelRepository.shared.isBuiltIn(trimmed) { return trimmed } |
| 1575 | // Saved providers use their stable id with "custom:" prefix (if not already present) |
| 1576 | if trimmed.hasPrefix("custom:") { return trimmed } |
| 1577 | return "custom:\(trimmed)" |
| 1578 | } |
| 1579 | |
| 1580 | private func updateCurrentProvider() { |
| 1581 | // Map baseURL to canonical key for built-ins; else keep existing |
no test coverage detected