diff --git a/server/djrandom/model/mp3.py b/server/djrandom/model/mp3.py index 3c728b626d67cc6ef32648ba76a12367495c8149..f9314351cc7313dd1b1470c98a74443a85e450cf 100644 --- a/server/djrandom/model/mp3.py +++ b/server/djrandom/model/mp3.py @@ -50,7 +50,7 @@ class MP3(Base): num_songs = cls.query.filter_by(ready=True).count() for idx in xrange(n): song = cls.query.filter_by(ready=True).limit(1).offset( - random.randint(num_songs)).one() + random.randint(0, num_songs - 1)).one() results.append(song) return results