- 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
35 lines
640 B
Go
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
|
|
}
|