Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix rss magnet link

Cette révision appartient à :
akuma06 2017-07-03 02:37:36 +02:00
Parent 5feec8748b
révision d16871d91a
2 fichiers modifiés avec 8 ajouts et 9 suppressions

Voir le fichier

@ -87,7 +87,7 @@ func RSSMagnetHandler(c *gin.Context) {
torrentJSON := torrent.ToJSON()
feed.Items[i] = &nyaafeeds.RssItem{
Title: torrentJSON.Name,
MagnetLink: &nyaafeeds.RssMagnetLink{Text: string(torrentJSON.Magnet)},
Link: &nyaafeeds.RssMagnetLink{Text: string(torrentJSON.Magnet)},
Description: string(torrentJSON.Description),
PubDate: torrent.Date.Format(time.RFC822),
GUID: config.WebAddress() + "/view/" + strconv.FormatUint(uint64(torrentJSON.ID), 10),

Voir le fichier

@ -71,14 +71,13 @@ type RssFeed struct {
}
type RssItem struct {
XMLName xml.Name `xml:"item"`
Title string `xml:"title"` // required
Link string `xml:"link,omitempty"`
MagnetLink *RssMagnetLink `xml:"link,omitempty"`
Description string `xml:"description"` // required
Author string `xml:"author,omitempty"`
Category *RssCategory `xml:"category,omitempty"`
Comments string `xml:"comments,omitempty"`
XMLName xml.Name `xml:"item"`
Title string `xml:"title"` // required
Link interface{} `xml:"link,omitempty"`
Description string `xml:"description"` // required
Author string `xml:"author,omitempty"`
Category *RssCategory `xml:"category,omitempty"`
Comments string `xml:"comments,omitempty"`
Enclosure *RssEnclosure
GUID string `xml:"guid,omitempty"` // Id used
PubDate string `xml:"pubDate,omitempty"` // created or updated