mmcdole / gofeed

Parse RSS, Atom and JSON feeds in Go
MIT License
2.51k stars 204 forks source link

Update translator.go #216

Closed Strubbl closed 9 months ago

Strubbl commented 9 months ago

I change the category atom translation from term to label, because there are feeds, which use the term as slug and prefix them with e.g. t:, but the label is the tag name then. When translating an atom feed to a generic feed, this would help to get more cleaner categories since the label does not have any prefix.

mmcdole commented 9 months ago

Given that Term is required and Label is optional, would you update this to at least fallback to Term if Label isn't present?

      if c.Label != "" {
            categories = append(categories, c.Label)
        } else {
            categories = append(categories, c.Term)
        }
Strubbl commented 9 months ago

Thank you for this hint. I updated this PR accordingly and squashed my commits.

mmcdole commented 9 months ago

Thank you!