aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/parse.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/parse.go')
-rw-r--r--internal/feed/parse.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/feed/parse.go b/internal/feed/parse.go
index 435c0ed..dfb447a 100644
--- a/internal/feed/parse.go
+++ b/internal/feed/parse.go
@@ -41,7 +41,7 @@ func httpClient(disableTLS bool) *http.Client {
return stdHTTPClient
}
-func parseFeed(feed *Feed) error {
+func (feed *Feed) parse() error {
ctx, cancel := context(feed.Global.Timeout)
defer cancel()
@@ -54,9 +54,9 @@ func parseFeed(feed *Feed) error {
}
feed.feed = parsedFeed
- feed.items = make([]feeditem, len(parsedFeed.Items))
- for idx, item := range parsedFeed.Items {
- feed.items[idx] = feeditem{Feed: parsedFeed, Item: item, itemId: shortuuid.New()}
+ feed.items = make([]item, len(parsedFeed.Items))
+ for idx, feedItem := range parsedFeed.Items {
+ feed.items[idx] = item{Feed: parsedFeed, Item: feedItem, itemId: shortuuid.New(), feed: feed}
}
return nil
}
@@ -64,7 +64,7 @@ func parseFeed(feed *Feed) error {
func handleFeed(feed *Feed) {
log.Printf("Fetching %s from %s", feed.Name, feed.Url)
- err := parseFeed(feed)
+ err := feed.parse()
if err != nil {
if feed.cached.Failures() >= feed.Global.MaxFailures {
log.Error(err)