aboutsummaryrefslogtreecommitdiff
path: root/errhandlers
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@protonmail.ch>2022-02-15 21:55:56 +0530
committerVidhu Kant Sharma <vidhukant@protonmail.ch>2022-02-15 21:55:56 +0530
commit831a57e8d065a01cefe40dd8545770064759eb13 (patch)
tree6531083aee49783e645cf57609a3cbbc64e4959d /errhandlers
parent74a5f1ce1594d01ef7caeb3c5fcac047a7d8f9b3 (diff)
somehow made UpdateAnime work decently
Diffstat (limited to 'errhandlers')
-rw-r--r--errhandlers/validators.go24
1 files changed, 24 insertions, 0 deletions
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
+}