diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-27 14:10:09 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-27 14:28:36 +0100 |
commit | 6ad93417790d0d63cd889ac65566fc4e4c3e34d1 (patch) | |
tree | 799043425accff66f43ec41b38f08d9eff2ea499 /internal/feed/item.go | |
parent | 050ce6e8f89d8d4e126481644023875eb3c6fb2e (diff) | |
download | feed2imap-go-6ad93417790d0d63cd889ac65566fc4e4c3e34d1.tar.gz feed2imap-go-6ad93417790d0d63cd889ac65566fc4e4c3e34d1.tar.bz2 feed2imap-go-6ad93417790d0d63cd889ac65566fc4e4c3e34d1.zip |
Do not use deprecated gofeed.Item.Author, but Authors instead
Diffstat (limited to 'internal/feed/item.go')
-rw-r--r-- | internal/feed/item.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/feed/item.go b/internal/feed/item.go index 39f41ba..f7dd506 100644 --- a/internal/feed/item.go +++ b/internal/feed/item.go @@ -4,6 +4,7 @@ import ( "encoding/base64" "encoding/json" "fmt" + "strings" "time" "github.com/google/uuid" @@ -44,12 +45,13 @@ func (item *Item) Date() string { return item.Updated } -// Creator returns the name of the creating author. +// Creator returns the name of the creating authors (comma separated). func (item *Item) Creator() string { - if item.Author != nil { - return item.Author.Name + names := make([]string, len(item.Authors)) + for i, p := range item.Authors { + names[i] = p.Name } - return "" + return strings.Join(names, ", ") } func (item *Item) FeedLink() string { |