From 937f3b8ada85274dfe3842f3dde8aef45c4f3ae7 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 13 Feb 2022 14:12:45 +0530 Subject: completed (?) the GetAnimeList function --- errhandlers/validators.go | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'errhandlers/validators.go') diff --git a/errhandlers/validators.go b/errhandlers/validators.go index f9baea1..6bf7a3f 100644 --- a/errhandlers/validators.go +++ b/errhandlers/validators.go @@ -86,7 +86,8 @@ func IsValidSeason(season string) bool { } // Checks if given sort is valid -func IsValidSort(sort string) bool { +// For seasonal anime lists +func IsValidSeasonalSort(sort string) bool { switch sort { case "anime_score", @@ -94,3 +95,30 @@ func IsValidSort(sort string) bool { } return false } + +// Checks if given sort is valid +// for user anime lists +func IsValidListSort(sort string) bool { + switch sort { + case + "list_score", + "list_updated_at", + "anime_title", + "anime_start_date", + "anime_id": return true + } + return false +} + +// Checks if given anime list status is valid +func IsValidListStatus(status string) bool { + switch status { + case + "watching", + "completed", + "on_hold", + "dropped", + "plan_to_watch": return true + } + return false +} -- cgit v1.2.3