Remove author when no fields are set

This commit is contained in:
Peter Stuifzand 2018-04-11 18:18:54 +02:00
parent c61fe38718
commit 5da097a91a

View File

@ -325,6 +325,14 @@ func (b *memoryBackend) feedItems(fetchURL, contentType string, body io.Reader)
} else {
log.Printf("Unknown Content-Type: %s\n", contentType)
}
for i, v := range items {
// Clear type of author, when other fields also aren't set
if v.Author.Name == "" && v.Author.Photo == "" && v.Author.URL == "" {
v.Type = ""
items[i] = v
}
}
return items, nil
}