Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix dates in RSS feed

Cette révision appartient à :
sfan5 2017-05-11 23:35:51 +02:00 révisé par Austin
Parent a96902a737
révision b6b2d836c0

Voir le fichier

@ -26,22 +26,20 @@ func RSSHandler(w http.ResponseWriter, r *http.Request) {
Link: &feeds.Link{Href: "https://" + config.WebAddress + "/"},
Created: createdAsTime,
}
feed.Items = []*feeds.Item{}
feed.Items = make([]*feeds.Item, len(torrents))
for i := range torrents {
torrentJSON := torrents[i].ToJSON()
for i, torrent := range torrents {
torrentJSON := torrent.ToJSON()
feed.Items[i] = &feeds.Item{
// need a torrent view first
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)},
Description: string(torrentJSON.Description),
Created: torrents[0].Date,
Updated: torrents[0].Date,
Created: torrent.Date,
Updated: torrent.Date,
}
}
//allow cross domain AJAX requests
// allow cross domain AJAX requests
w.Header().Set("Access-Control-Allow-Origin", "*")
rss, rssErr := feed.ToRss()
if rssErr != nil {