mirror of
https://github.com/spl0k/supysonic.git
synced 2024-11-10 04:02:17 +00:00
parent
692f7d86e3
commit
dba2a9b662
@ -60,6 +60,10 @@ def album_list():
|
||||
if ltype == 'random':
|
||||
albums = []
|
||||
count = query.count()
|
||||
|
||||
if not count:
|
||||
return request.formatter({ 'albumList': {} })
|
||||
|
||||
for _ in xrange(size):
|
||||
x = random.choice(xrange(count))
|
||||
albums.append(query.offset(x).limit(1).one())
|
||||
@ -106,6 +110,10 @@ def album_list_id3():
|
||||
if ltype == 'random':
|
||||
albums = []
|
||||
count = query.count()
|
||||
|
||||
if not count:
|
||||
return request.formatter({ 'albumList2': {} })
|
||||
|
||||
for _ in xrange(size):
|
||||
x = random.choice(xrange(count))
|
||||
albums.append(query.offset(x).limit(1).one())
|
||||
|
Loading…
Reference in New Issue
Block a user