From d16871d91ae7c191d35e36e758ddbc937bed897b Mon Sep 17 00:00:00 2001 From: akuma06 Date: Mon, 3 Jul 2017 02:37:36 +0200 Subject: [PATCH] Fix rss magnet link --- controllers/rss_handler.go | 2 +- utils/feeds/rss.go | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/controllers/rss_handler.go b/controllers/rss_handler.go index 5a7dbd1d..7cb95ff8 100644 --- a/controllers/rss_handler.go +++ b/controllers/rss_handler.go @@ -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), diff --git a/utils/feeds/rss.go b/utils/feeds/rss.go index 4c8acd32..1fdbb2f8 100644 --- a/utils/feeds/rss.go +++ b/utils/feeds/rss.go @@ -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