Sessions are almost in use now

This commit is contained in:
Eduard Urbach 2016-11-23 23:21:24 +09:00
parent 1db5d85a8a
commit 360c991884
3 changed files with 18 additions and 8 deletions

22
main.go
View File

@ -5,6 +5,7 @@ import (
"runtime"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/jobs"
"github.com/animenotifier/notify.moe/pages/airing"
@ -24,13 +25,22 @@ var app = aero.New()
func main() {
app.SetStyle(components.BundledCSS)
app.Config.GZipCache = false
// user, _ := arn.GetUserByNick("Akyoto")
// user.CoverImage.URL = "https://www.pixelstalk.net/wp-content/uploads/2016/10/Hanyijie-sky-scenery-ship-anime-art-1920x1080.jpg"
// user.CoverImage.Position.X = "50%"
// user.CoverImage.Position.Y = "0%"
// user.Save()
// app.Sessions = sessions.New(sessions.Config{
// Cookie: "sid",
// Expires: time.Duration(30) * time.Second,
// GcDuration: time.Duration(30) * time.Second,
// DecodeCookie: false,
// DisableSubdomainPersistence: false,
// })
app.Sessions.Store = aero.NewMemoryStore()
user, _ := arn.GetUserByNick("Akyoto")
user.CoverImage.URL = "https://www.pixelstalk.net/wp-content/uploads/2016/10/Hanyijie-sky-scenery-ship-anime-art-1920x1080.jpg"
user.CoverImage.Position.X = "50%"
user.CoverImage.Position.Y = "0%"
user.Save()
// Background jobs
go jobs.AiringAnime()

View File

@ -1,3 +1,3 @@
component Airing(animeList []*arn.Anime)
h2 Airing
h2(title=toString(len(animeList)) + " anime") Airing
AnimeGrid(animeList)

View File

@ -1,3 +1,3 @@
component Genre(genre *arn.Genre)
h2= arn.Capitalize(genre.ID)
h2(title=toString(len(genre.AnimeList)) + " anime")= arn.Capitalize(genre.ID)
AnimeGrid(genre.AnimeList)