Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix torznab to /api also

Torznab can still be accessed to /feed/torznab and also to
/api?t=something
Cette révision appartient à :
akuma06 2017-06-16 01:30:09 +02:00
Parent abcdfd426b
révision 8bddc86843

Voir le fichier

@ -27,6 +27,10 @@ import (
// APIHandler : Controller for api request on torrent list
func APIHandler(w http.ResponseWriter, r *http.Request) {
t := r.URL.Query().Get("t")
if t != "" {
RSSTorznabHandler(w, r)
} else {
vars := mux.Vars(r)
page := vars["page"]
whereParams := serviceBase.WhereParams{}
@ -91,6 +95,7 @@ func APIHandler(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}
}
// APIViewHandler : Controller for viewing a torrent by its ID