diff --git a/app/config.go b/app/config.go index fb68032..abdf5d8 100644 --- a/app/config.go +++ b/app/config.go @@ -110,11 +110,11 @@ func ParseConfig(configPath string) (*Config, error) { } func (fu *FeedURL) UnmarshalYAML(node *yaml.Node) error { - *fu = []string{""} switch node.Kind { case yaml.SequenceNode: return node.Decode((*[]string)(fu)) case yaml.ScalarNode: + *fu = []string{""} return node.Decode(&(*fu)[0]) } return fmt.Errorf("unexpected node type: %s, at %d:%d", node.ShortTag(), node.Line, node.Column) diff --git a/app/db.go b/app/db.go index faf7b1e..59cb371 100644 --- a/app/db.go +++ b/app/db.go @@ -78,6 +78,7 @@ func (d *db) Filter(entries []parser.FeedEntry) ([]parser.FeedEntry, error) { for _, entry := range entries { if _, ok := d.seenLinks[entry.Link]; !ok { filteredEntries = append(filteredEntries, entry) + d.seenLinks[entry.Link] = struct{}{} } } return filteredEntries, nil