feeds: report updates differently

If there are "0 updates" then don't report as such.

Found as http://bear.alienbase.nl/mirrors//alien-kde/ChangeLog.txt
updates don't match the same regex as slackware update entries, so it
reported 0 updates. This is a TODO to improve that regex.

Reported-by: alienBob
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2017-02-22 12:11:55 -05:00
parent cf4e6740bb
commit 1cca828855
Signed by: vbatts
GPG Key ID: 10937E57733F1362
1 changed files with 3 additions and 1 deletions

View File

@ -44,8 +44,10 @@ func ToFeed(link string, entries []Entry) (*feeds.Feed, error) {
}
if e.SecurityFix() {
feed.Items[i].Title = fmt.Sprintf("%d %s. Including a %s!", len(e.Updates), updateWord, securityFixStr)
} else if len(e.Updates) == 0 {
feed.Items[i].Title = ""
} else {
feed.Items[i].Title = fmt.Sprintf("%d %s.", len(e.Updates), updateWord)
feed.Items[i].Title = fmt.Sprintf("%d %s", len(e.Updates), updateWord)
}
}