aboutsummaryrefslogtreecommitdiff
path: root/lib/listenbrainz_util.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/listenbrainz_util.ml')
-rw-r--r--lib/listenbrainz_util.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/listenbrainz_util.ml b/lib/listenbrainz_util.ml
new file mode 100644
index 0000000..35a7af8
--- /dev/null
+++ b/lib/listenbrainz_util.ml
@@ -0,0 +1,9 @@
+open Listenbrainz_t
+
+let validate_submission s =
+ match s.listen_type with
+ | `Single -> List.length s.payload = 1
+ | _ -> true
+
+let validate_response r =
+ List.length r.listens = r.count