feat(sources): enforce supported source allowlist

Assign stable keys to the three supported sources, preserve excluded historical rows, and expose history read-only in admin. Add migration, coverage, and responsive browser spec.

Refs #13

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 00:11:26 +01:00
parent 4459a81206
commit ac17d27f51
26 changed files with 924 additions and 61 deletions

View File

@ -11,7 +11,6 @@ import (
"github.com/tradarr/backend/internal/models"
"github.com/tradarr/backend/internal/scraper"
"github.com/tradarr/backend/internal/scraper/bloomberg"
"github.com/tradarr/backend/internal/scraper/reuters"
"github.com/tradarr/backend/internal/scraper/watcherguru"
"github.com/tradarr/backend/internal/scraper/yahoofinance"
"github.com/tradarr/backend/internal/server"
@ -40,9 +39,10 @@ func main() {
log.Printf("ensure admin: %v", err)
}
feeds := map[string]scraper.Scraper{}
for _, feed := range []scraper.Scraper{bloomberg.NewDynamic(repo, enc, cfg.ScraperURL), yahoofinance.New(), reuters.New(), watcherguru.New()} {
feeds[feed.Name()] = feed
feeds := map[string]scraper.Scraper{
models.SourceBloomberg: bloomberg.NewDynamic(repo, enc, cfg.ScraperURL),
models.SourceYahooFinance: yahoofinance.New(),
models.SourceWatcherGuru: watcherguru.New(),
}
app := server.New(repo, cfg, server.Dependencies{Feeds: feeds, IndexSearcher: openfigi.New(openfigi.Config{APIKey: cfg.OpenFIGIAPIKey, Timeout: cfg.OpenFIGITimeout}, nil), EnableScheduler: true})