mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
update comments
This commit is contained in:
parent
996bcdc90d
commit
19c6d90915
@ -22,7 +22,7 @@ var debounce = function(callback, wait) {
|
||||
}
|
||||
|
||||
var sanitize = function(content, base) {
|
||||
// NOTE: `item.link` is not always a valid url
|
||||
// WILD: `item.link` is not always a valid url
|
||||
try { new URL(base) } catch(err) { base = null }
|
||||
|
||||
var sanitizer = new DOMPurify
|
||||
|
@ -94,7 +94,7 @@ func discoverFeed(url string) (*gofeed.Feed, *[]FeedSource, error) {
|
||||
feedparser := gofeed.NewParser()
|
||||
feed, err := feedparser.Parse(bytes.NewReader(content))
|
||||
if err == nil {
|
||||
// WILD: some feeds do not have link to itself
|
||||
// WILD: feeds may not always have link to themselves
|
||||
if len(feed.FeedLink) == 0 {
|
||||
feed.FeedLink = url
|
||||
}
|
||||
|
@ -73,9 +73,11 @@ func (s *Storage) CreateItems(items []Item) bool {
|
||||
now := time.Now()
|
||||
|
||||
for _, item := range items {
|
||||
// WILD: some feeds provide only `item.date_updated` (without `item.date_created`)
|
||||
if item.Date == nil {
|
||||
item.Date = item.DateUpdated
|
||||
}
|
||||
// WILD: `item.guid` is not always present
|
||||
if item.GUID == "" {
|
||||
item.GUID = item.Link
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user