1
0
Fork 0
mirror of https://github.com/vbatts/sl-feeds.git synced 2024-11-24 16:45:39 +00:00

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

View file

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