Fix up rss handler spec violations
Cette révision appartient à :
Parent
f31d884f6a
révision
0cfacdd48d
1 fichiers modifiés avec 9 ajouts et 9 suppressions
|
@ -5,6 +5,7 @@ import (
|
|||
"html"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"sort"
|
||||
|
@ -43,13 +44,12 @@ func RSSHandler(w http.ResponseWriter, r *http.Request) {
|
|||
torrentJSON := torrent.ToJSON()
|
||||
feed.Items[i] = &nyaafeeds.RssItem{
|
||||
Title: torrentJSON.Name,
|
||||
Link: config.WebAddress() + "/view/" + strconv.FormatUint(uint64(torrentJSON.ID), 10),
|
||||
Link: config.WebAddress() + "/download/" + torrentJSON.Hash,
|
||||
Description: string(torrentJSON.Description),
|
||||
Author: config.WebAddress() + "/view/" + strconv.FormatUint(uint64(torrentJSON.ID), 10),
|
||||
PubDate: torrent.Date.String(),
|
||||
GUID: config.WebAddress() + "/download/" + torrentJSON.Hash,
|
||||
PubDate: torrent.Date.Format(time.RFC822),
|
||||
GUID: config.WebAddress() + "view" + strconv.FormatUint(uint64(torrentJSON.ID), 10),
|
||||
Enclosure: &nyaafeeds.RssEnclosure{
|
||||
URL: config.WebAddress() + "/download/" + torrentJSON.Hash,
|
||||
URL: config.WebAddress() + "/download/" + strings.TrimSpace(torrentJSON.Hash),
|
||||
Length: strconv.FormatUint(uint64(torrentJSON.Filesize), 10),
|
||||
Type: "application/x-bittorrent",
|
||||
},
|
||||
|
@ -97,10 +97,10 @@ func RSSEztvHandler(w http.ResponseWriter, r *http.Request) {
|
|||
},
|
||||
Description: string(torrentJSON.Description),
|
||||
Comments: config.WebAddress() + "/view/" + strconv.FormatUint(uint64(torrentJSON.ID), 10),
|
||||
PubDate: torrent.Date.String(),
|
||||
PubDate: torrent.Date.Format(time.RFC822),
|
||||
GUID: config.WebAddress() + "/view/" + strconv.FormatUint(uint64(torrentJSON.ID), 10),
|
||||
Enclosure: &nyaafeeds.RssEnclosure{
|
||||
URL: config.WebAddress() + "/download/" + torrentJSON.Hash,
|
||||
URL: config.WebAddress() + "/download/" + strings.TrimSpace(torrentJSON.Hash),
|
||||
Length: strconv.FormatUint(uint64(torrentJSON.Filesize), 10),
|
||||
Type: "application/x-bittorrent",
|
||||
},
|
||||
|
@ -242,10 +242,10 @@ func RSSTorznabHandler(w http.ResponseWriter, r *http.Request) {
|
|||
},
|
||||
Description: string(torrentJSON.Description),
|
||||
Comments: config.WebAddress() + "/view/" + strconv.FormatUint(uint64(torrentJSON.ID), 10),
|
||||
PubDate: torrent.Date.String(),
|
||||
PubDate: torrent.Date.Format(time.RFC822),
|
||||
GUID: config.WebAddress() + "/view/" + strconv.FormatUint(uint64(torrentJSON.ID), 10),
|
||||
Enclosure: &nyaafeeds.RssEnclosure{
|
||||
URL: config.WebAddress() + "/download/" + torrentJSON.Hash,
|
||||
URL: config.WebAddress() + "/download/" + strings.TrimSpace(torrentJSON.Hash),
|
||||
Length: strconv.FormatUint(uint64(torrentJSON.Filesize), 10),
|
||||
Type: "application/x-bittorrent",
|
||||
},
|
||||
|
|
Référencer dans un nouveau ticket