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:
parent
2ba893bc79
commit
dd4fb660c1
11 changed files with 795 additions and 500 deletions
|
@ -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...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue