Update updated of feed when adding an object
This commit is contained in:
parent
8863e97f1f
commit
e1ba1b8277
12
feed.go
12
feed.go
@ -48,6 +48,8 @@ func (f *Feed) AddAuthor(p *Person) {
|
||||
} else {
|
||||
f.Authors = append(f.Authors, p)
|
||||
}
|
||||
|
||||
f.Updated.DateTime = DateTime(time.Now())
|
||||
}
|
||||
|
||||
// AddCategory adds the category to the feed.
|
||||
@ -58,6 +60,8 @@ func (f *Feed) AddCategory(c *Category) {
|
||||
} else {
|
||||
f.Categories = append(f.Categories, c)
|
||||
}
|
||||
|
||||
f.Updated.DateTime = DateTime(time.Now())
|
||||
}
|
||||
|
||||
// AddContributor adds the contributor to the feed.
|
||||
@ -68,6 +72,8 @@ func (f *Feed) AddContributor(c *Person) {
|
||||
} else {
|
||||
f.Contributors = append(f.Contributors, c)
|
||||
}
|
||||
|
||||
f.Updated.DateTime = DateTime(time.Now())
|
||||
}
|
||||
|
||||
// AddLink adds the link to the feed.
|
||||
@ -79,6 +85,8 @@ func (f *Feed) AddLink(l *Link) {
|
||||
} else {
|
||||
f.Links = append(f.Links, l)
|
||||
}
|
||||
|
||||
f.Updated.DateTime = DateTime(time.Now())
|
||||
}
|
||||
|
||||
// AddExtension adds the extension to the feed.
|
||||
@ -89,6 +97,8 @@ func (f *Feed) AddExtension(e *ExtensionElement) {
|
||||
} else {
|
||||
f.Extensions = append(f.Extensions, e)
|
||||
}
|
||||
|
||||
f.Updated.DateTime = DateTime(time.Now())
|
||||
}
|
||||
|
||||
// AddEntry adds the entry to the feed.
|
||||
@ -99,6 +109,8 @@ func (f *Feed) AddEntry(e *Entry) {
|
||||
} else {
|
||||
f.Entries = append(f.Entries, e)
|
||||
}
|
||||
|
||||
f.Updated.DateTime = DateTime(time.Now())
|
||||
}
|
||||
|
||||
// Check checks the feed for incompatibilities with RFC4287.
|
||||
|
Loading…
x
Reference in New Issue
Block a user