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

View File

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

View File

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