2018-04-25 18:03:35 +00:00
|
|
|
package animeroutes
|
|
|
|
|
|
|
|
import (
|
2018-12-11 06:37:15 +00:00
|
|
|
"github.com/aerogo/aero"
|
2018-04-25 18:03:35 +00:00
|
|
|
"github.com/aerogo/layout"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/anime"
|
2018-04-25 18:23:35 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/anime/editanime"
|
2018-04-25 18:03:35 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/episode"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/genre"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/genres"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Register registers the page routes.
|
2018-12-11 06:37:15 +00:00
|
|
|
func Register(l *layout.Layout, app *aero.Application) {
|
2018-04-25 18:03:35 +00:00
|
|
|
// Anime
|
|
|
|
l.Page("/anime/:id", anime.Get)
|
|
|
|
l.Page("/anime/:id/episodes", anime.Episodes)
|
|
|
|
l.Page("/anime/:id/characters", anime.Characters)
|
|
|
|
l.Page("/anime/:id/tracks", anime.Tracks)
|
|
|
|
l.Page("/anime/:id/relations", anime.Relations)
|
2018-11-01 05:45:16 +00:00
|
|
|
l.Page("/anime/:id/comments", anime.Comments)
|
2018-04-25 18:03:35 +00:00
|
|
|
l.Page("/anime/:id/episode/:episode-number", episode.Get)
|
2018-12-11 06:37:15 +00:00
|
|
|
app.Get("/anime/:id/episode/:episode-number/subtitles/:language", episode.Subtitles)
|
2018-04-25 18:03:35 +00:00
|
|
|
|
|
|
|
// Anime redirects
|
|
|
|
l.Page("/kitsu/anime/:id", anime.RedirectByMapping("kitsu/anime"))
|
|
|
|
l.Page("/mal/anime/:id", anime.RedirectByMapping("myanimelist/anime"))
|
|
|
|
l.Page("/anilist/anime/:id", anime.RedirectByMapping("anilist/anime"))
|
|
|
|
|
|
|
|
// Edit anime
|
|
|
|
l.Page("/anime/:id/edit", editanime.Main)
|
|
|
|
l.Page("/anime/:id/edit/images", editanime.Images)
|
|
|
|
l.Page("/anime/:id/edit/characters", editanime.Characters)
|
|
|
|
l.Page("/anime/:id/edit/relations", editanime.Relations)
|
|
|
|
l.Page("/anime/:id/edit/episodes", editanime.Episodes)
|
|
|
|
l.Page("/anime/:id/edit/history", editanime.History)
|
|
|
|
|
|
|
|
// Genres
|
|
|
|
l.Page("/genres", genres.Get)
|
|
|
|
l.Page("/genre/:name", genre.Get)
|
|
|
|
}
|