mirror of
https://github.com/ultrasn0w/huso.git
synced 2025-12-13 13:59:53 +01:00
Aufräumen
This commit is contained in:
20
ober.go
20
ober.go
@@ -26,19 +26,13 @@ func RunWebserv() {
|
||||
}
|
||||
|
||||
func Start(ctx *fasthttp.RequestCtx) {
|
||||
data, err := cache.Get(seasonApiJikan)
|
||||
if err != nil {
|
||||
addErrorToCtx(ctx, err)
|
||||
return
|
||||
}
|
||||
var seasonData SeasonJikan
|
||||
err = json.Unmarshal(data, &seasonData)
|
||||
season, err := GetSeasonCache()
|
||||
if err != nil {
|
||||
addErrorToCtx(ctx, err)
|
||||
return
|
||||
}
|
||||
|
||||
WriteIndex(ctx, &seasonData)
|
||||
WriteIndex(ctx, season)
|
||||
|
||||
ctx.SetContentType("text/html; charset=utf-8")
|
||||
ctx.SetStatusCode(fasthttp.StatusOK)
|
||||
@@ -50,12 +44,6 @@ func Season(ctx *fasthttp.RequestCtx) {
|
||||
addErrorToCtx(ctx, err)
|
||||
return
|
||||
}
|
||||
var seasonData SeasonJikan
|
||||
err = json.Unmarshal(data, &seasonData)
|
||||
if err != nil {
|
||||
addErrorToCtx(ctx, err)
|
||||
return
|
||||
}
|
||||
|
||||
_, err = ctx.Write(data)
|
||||
if err != nil {
|
||||
@@ -201,7 +189,9 @@ func WatchPost(ctx *fasthttp.RequestCtx) {
|
||||
}
|
||||
|
||||
for _, anime := range animes {
|
||||
// TODO iterate animes
|
||||
// TODO check if anime is in season
|
||||
|
||||
// iterate sent animes
|
||||
detail, _, err := GetAnimeDetailData(anime.Anime)
|
||||
if err != nil {
|
||||
ctx.WriteString(err.Error())
|
||||
|
||||
Reference in New Issue
Block a user