1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Refactor Atom parser to use an adapter

This commit is contained in:
Frédéric Guillot 2024-03-15 16:39:32 -07:00
parent 2ba893bc79
commit dd4fb660c1
11 changed files with 795 additions and 500 deletions

View file

@ -98,7 +98,6 @@ func (j *JSONAdapter) BuildFeed(feedURL string) *model.Feed {
}
// Populate the entry date.
entry.Date = time.Now()
for _, value := range []string{item.DatePublished, item.DateModified} {
value = strings.TrimSpace(value)
if value != "" {
@ -114,6 +113,9 @@ func (j *JSONAdapter) BuildFeed(feedURL string) *model.Feed {
}
}
}
if entry.Date.IsZero() {
entry.Date = time.Now()
}
// Populate the entry author.
itemAuthors := append(item.Authors, j.jsonFeed.Authors...)