Files
TradarrV2/backend/internal/models/source_support.go
Blomios 64a7124889 feat(sources): replace WatcherGuru with CNBC Business
Add the CNBC Business RSS source, switch supported-source wiring and reporting, and migrate existing WatcherGuru rows to disabled historical status without rewriting references.

Refs #23

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-22 17:17:15 +01:00

28 lines
743 B
Go

package models
const (
SourceYahooFinance = "yahoo_finance"
SourceBloomberg = "bloomberg"
SourceWatcherGuru = "watcher_guru" // Historical identity; no longer executable.
SourceCNBCBusiness = "cnbc_business"
)
func SupportedSourceKey(key string) bool {
switch key {
case SourceYahooFinance, SourceBloomberg, SourceCNBCBusiness:
return true
}
return false
}
func (s Source) Supported() bool { return s.SourceKey != nil && SupportedSourceKey(*s.SourceKey) }
func (s Source) Operational() bool { return s.Enabled && s.Supported() }
func OperationalSources(sources []Source) []Source {
result := []Source{}
for _, source := range sources {
if source.Operational() {
result = append(result, source)
}
}
return result
}