add post title to rss item
This commit is contained in:
@@ -175,6 +175,10 @@ func (s *Rest) toRssFeed(url string, comments []store.Comment) (string, error) {
|
||||
log.Printf("[WARN] failed to get info about parent comment, %s", err)
|
||||
}
|
||||
}
|
||||
if c.PostTitle != "" {
|
||||
f.Title = f.Title + ", " + c.PostTitle
|
||||
}
|
||||
|
||||
feed.Items = append(feed.Items, &f)
|
||||
if i > maxRssItems {
|
||||
break
|
||||
|
||||
@@ -94,7 +94,7 @@ func TestService_CreateFromPartialWithTitle(t *testing.T) {
|
||||
res, err := b.Get(store.Locator{URL: "https://radio-t.com/p/2018/12/29/podcast-630/", SiteID: "radio-t"}, id)
|
||||
assert.NoError(t, err)
|
||||
t.Logf("%+v", res)
|
||||
assert.Equal(t, "Радио-Т 630 - Радио-Т Подкаст", res.PostTitle)
|
||||
assert.Equal(t, "Радио-Т 630", res.PostTitle)
|
||||
|
||||
comment.PostTitle = "post blah"
|
||||
id, err = b.Create(comment)
|
||||
|
||||
Reference in New Issue
Block a user