Skip to content
Snippets Groups Projects
Commit 697d2d3a authored by ale's avatar ale
Browse files

play_count should not fail on None values

parent 76c73241
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,10 @@ def play_callback(sha1):
mp3 = MP3.query.get(sha1)
if not mp3:
abort(404)
if mp3.play_count:
mp3.play_count += 1
else:
mp3.play_count = 1
Session.add(mp3)
Session.commit()
return jsonify(status=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment