Compare commits

...

2 Commits

Author SHA1 Message Date
d7834ebf53
Remove author completely when fields are missing
All checks were successful
the build was successful
2018-08-29 21:22:03 +02:00
78cace26d9
Remove uses of Summary 2018-08-29 21:21:41 +02:00
2 changed files with 1 additions and 10 deletions

View File

@ -261,7 +261,6 @@ func FeedItems(fetcher Fetcher, fetchURL, contentType string, body io.Reader) ([
item.Content.HTML = feedItem.ContentHTML
item.Content.Text = feedItem.ContentText
item.URL = feedItem.URL
item.Summary = append(item.Summary, feedItem.Summary)
item.ID = hex.EncodeToString([]byte(feedItem.ID))
item.Published = feedItem.DatePublished
@ -303,8 +302,6 @@ func FeedItems(fetcher Fetcher, fetchURL, contentType string, body io.Reader) ([
if len(feedItem.Summary) > 0 {
if len(item.Content.HTML) == 0 {
item.Content.HTML = feedItem.Summary
} else {
item.Summary = append(item.Summary, feedItem.Summary)
}
}
item.URL = feedItem.Link
@ -331,7 +328,7 @@ func FeedItems(fetcher Fetcher, fetchURL, contentType string, body io.Reader) ([
for i, v := range items {
// Clear type of author, when other fields also aren't set
if v.Author != nil && v.Author.Name == "" && v.Author.Photo == "" && v.Author.URL == "" {
v.Author.Type = ""
v.Author = nil
items[i] = v
}
}

View File

@ -257,12 +257,6 @@ func MapToItem(result map[string]interface{}) microsub.Item {
}
}
if summary, e := result["summary"]; e {
if summaryString, ok := summary.(string); ok {
item.Summary = append(item.Summary, summaryString)
}
}
if content, e := result["content"]; e {
itemContent := &microsub.Content{}
set := false