Added season filters

This commit is contained in:
2018-04-13 17:55:52 +02:00
parent 1cedabb47b
commit cff76bc696
10 changed files with 141 additions and 60 deletions

View File

@ -19,12 +19,17 @@ func CompareMAL(ctx *aero.Context) string {
user := utils.GetUser(ctx)
year := ctx.Get("year")
status := ctx.Get("status")
season := ctx.Get("season")
typ := ctx.Get("type")
if year == "any" {
year = ""
}
if season == "any" {
season = ""
}
if status == "any" {
status = ""
}
@ -35,6 +40,7 @@ func CompareMAL(ctx *aero.Context) string {
settings := user.Settings()
settings.Editor.Filter.Year = year
settings.Editor.Filter.Season = season
settings.Editor.Filter.Status = status
settings.Editor.Filter.Type = typ
settings.Save()
@ -48,6 +54,10 @@ func CompareMAL(ctx *aero.Context) string {
return false
}
if season != "" && anime.Season() != season {
return false
}
if typ != "" && anime.Type != typ {
return false
}