Skip to content

Commit

Permalink
feat: Set the source in the entry when fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
panigrc committed Mar 25, 2023
1 parent 1b6106b commit 92d1f83
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/goeland/fetch/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func fetchFeed(source *goeland.Source, feedLocation string, isFile bool, allowIn
return fmt.Errorf("cannot open or parse url: %s (%v)", feedLocation, err)
}
}

source.Title = feed.Title
source.URL = feed.Link

for _, item := range feed.Items {

entry := goeland.Entry{}
Expand Down Expand Up @@ -119,10 +123,9 @@ func fetchFeed(source *goeland.Source, feedLocation string, isFile bool, allowIn
hash.Write([]byte(entry.URL))
entry.UID = hex.EncodeToString(hash.Sum([]byte{}))
}
entry.Source = *source
source.Entries = append(source.Entries, entry)
}
source.Title = feed.Title
source.URL = feed.Link
return nil
}

Expand Down

0 comments on commit 92d1f83

Please sign in to comment.