aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/item.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--internal/feed/item.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/internal/feed/item.go b/internal/feed/item.go
index b8fb7f7..bbf7668 100644
--- a/internal/feed/item.go
+++ b/internal/feed/item.go
@@ -17,8 +17,8 @@ type feedImage struct {
}
type item struct {
- *gofeed.Feed
*gofeed.Item
+ Feed *gofeed.Feed
feed *Feed
Body string
updateOnly bool
@@ -28,14 +28,22 @@ type item struct {
}
// Creator returns the name of the creating author.
-// MUST NOT have `*item` has the receiver, because the template breaks then.
func (item *item) Creator() string {
- if item.Item.Author != nil {
- return item.Item.Author.Name
+ if item.Author != nil {
+ return item.Author.Name
}
return ""
}
+func (item *item) FeedLink() string {
+ if item.Feed.Link != "" {
+ // the one in the feed itself
+ return item.Feed.FeedLink
+ }
+ // the one in the config
+ return item.feed.Url
+}
+
func (item *item) addReason(reason string) {
if !util.StrContains(item.reasons, reason) {
item.reasons = append(item.reasons, reason)