Skip to content

Commit 5387a67

Browse files
committed
check digit on rating (default 0)
1 parent 9d3860d commit 5387a67

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/ampache.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,6 +3011,10 @@ def rate(self, object_type, object_id, rating):
30113011
* object_id = (integer) $object_id
30123012
* rating = (integer) 0|1|2|3|4|5
30133013
"""
3014+
if rating.isdigit():
3015+
rating = int(rating)
3016+
else:
3017+
rating = 0
30143018
if (rating < 0 or rating > 5) or not (
30153019
object_type == 'song' or object_type == 'album' or object_type == 'artist'):
30163020
return False

0 commit comments

Comments
 (0)