67d8492380
* Update view.jet.html * Update router.go * Create stats.go * Update view.jet.html * Update stats.go * Update stats.go * rollback * returns -1 by default * Update stats.go * Update stats.go * Import goscrape & torrent * copypaste stats.go from scrapers * travis * Update stats.go * Update stats.go * Put fresh stats into a <span> * Background-color for freshly fetched stats * ditto but for tomorrow * "Loading..." text in case it gets a bit too long * Stat fetching in controller (missing DB update) * Update last scraped date too * update torrent.Scrape tho it doesn't do anything * forgot to edit a name * Update scrape.go * Update stats.go * Update stats.go * flush cache to update stats in listing * Change function name * Update stats.go * Update stats.go * fix travis * Update view.jet.html * Update stats.go * Update stats.go * Update stats.go * Update stats.go * Update stats.go
28 lignes
878 o
Go
28 lignes
878 o
Go
package torrentController
|
|
|
|
import (
|
|
"github.com/NyaaPantsu/nyaa/controllers/middlewares"
|
|
"github.com/NyaaPantsu/nyaa/controllers/router"
|
|
)
|
|
|
|
func init() {
|
|
router.Get().Any("/download/:hash", DownloadTorrent)
|
|
router.Get().Any("/stats/:id", GetStatsHandler)
|
|
|
|
torrentRoutes := router.Get().Group("/torrent", middlewares.LoggedInMiddleware())
|
|
{
|
|
torrentRoutes.GET("/", TorrentEditUserPanel)
|
|
torrentRoutes.POST("/", TorrentPostEditUserPanel)
|
|
torrentRoutes.GET("/tag", ViewFormTag)
|
|
torrentRoutes.POST("/tag", ViewFormTag)
|
|
torrentRoutes.GET("/tag/add", AddTag)
|
|
torrentRoutes.GET("/tag/remove", DeleteTag)
|
|
torrentRoutes.GET("/delete", TorrentDeleteUserPanel)
|
|
}
|
|
torrentViewRoutes := router.Get().Group("/view")
|
|
{
|
|
torrentViewRoutes.GET("/:id", ViewHandler)
|
|
torrentViewRoutes.HEAD("/:id", ViewHeadHandler)
|
|
torrentViewRoutes.POST("/:id", PostCommentHandler)
|
|
}
|
|
}
|