add post title to rss item

This commit is contained in:
Umputun
2019-01-06 15:31:29 -06:00
parent 6edd24185c
commit 8d978ffaf1
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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
+1 -1
View File
@@ -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)