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