aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/feed.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/feed.go')
-rw-r--r--internal/feed/feed.go43
1 files changed, 1 insertions, 42 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index 9ed44df..4a0e724 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -7,13 +7,12 @@ import (
"github.com/Necoro/feed2imap-go/pkg/config"
"github.com/Necoro/feed2imap-go/pkg/log"
- "github.com/Necoro/feed2imap-go/pkg/util"
)
type Feed struct {
*config.Feed
feed *gofeed.Feed
- items []feeditem
+ items []item
cached CachedFeed
Global config.GlobalOptions
}
@@ -23,46 +22,6 @@ type feedDescriptor struct {
Url string
}
-type feedImage struct {
- image []byte
- mime string
-}
-
-type feeditem struct {
- *gofeed.Feed
- *gofeed.Item
- Body string
- updateOnly bool
- reasons []string
- images []feedImage
- itemId string
-}
-
-// Creator returns the name of the creating author.
-// MUST NOT have `*feeditem` has the receiver, because the template breaks then.
-func (item feeditem) Creator() string {
- if item.Item.Author != nil {
- return item.Item.Author.Name
- }
- return ""
-}
-
-func (item *feeditem) addReason(reason string) {
- if !util.StrContains(item.reasons, reason) {
- item.reasons = append(item.reasons, reason)
- }
-}
-
-func (item *feeditem) addImage(img []byte, mime string) int {
- i := feedImage{img, mime}
- item.images = append(item.images, i)
- return len(item.images)
-}
-
-func (item *feeditem) clearImages() {
- item.images = []feedImage{}
-}
-
func (feed *Feed) descriptor() feedDescriptor {
return feedDescriptor{
Name: feed.Name,
15:05:08 +0200'>2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1