Add per-source language filter

When a source sets language = "en", drop items whose per-item
language tag is present and doesn't prefix-match. Items without
a language tag pass through unchanged. Politico Europe is the
motivating case — same headlines appear in en, fr, and de.
This commit is contained in:
prosolis
2026-05-26 23:03:12 -07:00
parent 7d469cf8c5
commit 78fc3ef811
2 changed files with 16 additions and 0 deletions

View File

@@ -70,6 +70,10 @@ type SourceConfig struct {
PollIntervalMinutes int `toml:"poll_interval_minutes"`
DirectRoute string `toml:"direct_route"`
Enabled bool `toml:"enabled"`
// Language, when set, drops feed items whose per-item language tag is
// present and does not match (prefix). Useful for multilingual feeds
// like Politico Europe that publish English + French side-by-side.
Language string `toml:"language"`
}
func Load(path string) (*Config, error) {