Added season filters
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user