mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-14 12:04:41 +00:00
substitute post content where possible
This commit is contained in:
@@ -63,11 +63,17 @@ func (e *Feeds) fetch(f *feeds.Feed) error {
|
||||
tags = append(tags, f.Category)
|
||||
}
|
||||
|
||||
// check if content exists
|
||||
content := item.Content
|
||||
if len(content) == 0 && len(item.Summary) > 0 {
|
||||
content = item.Summary
|
||||
}
|
||||
|
||||
// @todo make this optional
|
||||
_, err := e.postsService.Save(context.TODO(), &posts.SaveRequest{
|
||||
Id: id,
|
||||
Title: item.Title,
|
||||
Content: item.Content,
|
||||
Content: content,
|
||||
Timestamp: item.Date.Unix(),
|
||||
Metadata: map[string]string{
|
||||
"domain": domain,
|
||||
|
||||
Reference in New Issue
Block a user