Files
silo-server/internal/requests/arrclient/options.go
Silo Server Migration 246c9da6ab feat(requests): add media request system with Radarr/Sonarr fulfillment
- Add request domain, repository, service, and reconcile task
- Add Radarr/Sonarr fulfillment adapters and TMDB discovery
- Expose user and admin request APIs with quota and approval rules
- Add web UI for browsing, requesting, and admin queue management
- Migration 139 introduces media_requests and related tables
2026-05-24 13:58:12 -04:00

35 lines
640 B
Go

package arrclient
import (
"strconv"
"strings"
)
func BoolOption(options map[string]any, key string, fallback bool) bool {
value, ok := options[key]
if !ok {
return fallback
}
switch typed := value.(type) {
case bool:
return typed
case string:
parsed, err := strconv.ParseBool(strings.TrimSpace(typed))
if err == nil {
return parsed
}
}
return fallback
}
func StringOption(options map[string]any, key, fallback string) string {
value, ok := options[key]
if !ok {
return fallback
}
if typed, ok := value.(string); ok && strings.TrimSpace(typed) != "" {
return strings.TrimSpace(typed)
}
return fallback
}