From 831a57e8d065a01cefe40dd8545770064759eb13 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Tue, 15 Feb 2022 21:55:56 +0530 Subject: somehow made UpdateAnime work decently --- errhandlers/validators.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'errhandlers') diff --git a/errhandlers/validators.go b/errhandlers/validators.go index 6bf7a3f..1be61cb 100644 --- a/errhandlers/validators.go +++ b/errhandlers/validators.go @@ -122,3 +122,27 @@ func IsValidListStatus(status string) bool { } return false } + +// Checks if given anime score is valid +func IsValidScore(score int) bool { + if score >= 0 && score <= 10 { + return true + } + return false +} + +// Checks if given anime priority is valid +func IsValidPriority(priority int) bool { + if priority >= 0 && priority <= 2 { + return true + } + return false +} + +// Checks if given rewatch value is valid +func IsValidRewatchValue(r int) bool { + if r >= 0 && r <= 5 { + return true + } + return false +} -- cgit v1.2.3