Fix dates in RSS feed
Cette révision appartient à :
Parent
a96902a737
révision
b6b2d836c0
1 fichiers modifiés avec 6 ajouts et 8 suppressions
|
@ -26,22 +26,20 @@ func RSSHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
Link: &feeds.Link{Href: "https://" + config.WebAddress + "/"},
|
Link: &feeds.Link{Href: "https://" + config.WebAddress + "/"},
|
||||||
Created: createdAsTime,
|
Created: createdAsTime,
|
||||||
}
|
}
|
||||||
feed.Items = []*feeds.Item{}
|
|
||||||
feed.Items = make([]*feeds.Item, len(torrents))
|
feed.Items = make([]*feeds.Item, len(torrents))
|
||||||
|
|
||||||
for i := range torrents {
|
for i, torrent := range torrents {
|
||||||
torrentJSON := torrents[i].ToJSON()
|
torrentJSON := torrent.ToJSON()
|
||||||
feed.Items[i] = &feeds.Item{
|
feed.Items[i] = &feeds.Item{
|
||||||
// need a torrent view first
|
|
||||||
Id: "https://" + config.WebAddress + "/view/" + strconv.FormatUint(uint64(torrents[i].ID), 10),
|
Id: "https://" + config.WebAddress + "/view/" + strconv.FormatUint(uint64(torrents[i].ID), 10),
|
||||||
Title: torrents[i].Name,
|
Title: torrent.Name,
|
||||||
Link: &feeds.Link{Href: string(torrentJSON.Magnet)},
|
Link: &feeds.Link{Href: string(torrentJSON.Magnet)},
|
||||||
Description: string(torrentJSON.Description),
|
Description: string(torrentJSON.Description),
|
||||||
Created: torrents[0].Date,
|
Created: torrent.Date,
|
||||||
Updated: torrents[0].Date,
|
Updated: torrent.Date,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//allow cross domain AJAX requests
|
// allow cross domain AJAX requests
|
||||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
rss, rssErr := feed.ToRss()
|
rss, rssErr := feed.ToRss()
|
||||||
if rssErr != nil {
|
if rssErr != nil {
|
||||||
|
|
Référencer dans un nouveau ticket