mirror of
https://github.com/spl0k/supysonic.git
synced 2024-11-10 04:02:17 +00:00
parent
e5d9050fa7
commit
b4a9a21671
@ -7,7 +7,6 @@
|
|||||||
#
|
#
|
||||||
# Distributed under terms of the GNU AGPLv3 license.
|
# Distributed under terms of the GNU AGPLv3 license.
|
||||||
|
|
||||||
import random
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
@ -45,7 +44,7 @@ def rand_songs():
|
|||||||
query = query.filter(lambda t: t.root_folder.id == fid)
|
query = query.filter(lambda t: t.root_folder.id == fid)
|
||||||
|
|
||||||
return request.formatter('randomSongs', dict(
|
return request.formatter('randomSongs', dict(
|
||||||
song = [ t.as_subsonic_child(request.user, request.client) for t in query.random(size) ]
|
song = [ t.as_subsonic_child(request.user, request.client) for t in query.without_distinct().random(size) ]
|
||||||
))
|
))
|
||||||
|
|
||||||
@api.route('/getAlbumList.view', methods = [ 'GET', 'POST' ])
|
@api.route('/getAlbumList.view', methods = [ 'GET', 'POST' ])
|
||||||
@ -59,7 +58,7 @@ def album_list():
|
|||||||
query = select(t.folder for t in Track)
|
query = select(t.folder for t in Track)
|
||||||
if ltype == 'random':
|
if ltype == 'random':
|
||||||
return request.formatter('albumList', dict(
|
return request.formatter('albumList', dict(
|
||||||
album = [ a.as_subsonic_child(request.user) for a in query.random(size) ]
|
album = [ a.as_subsonic_child(request.user) for a in query.without_distinct().random(size) ]
|
||||||
))
|
))
|
||||||
elif ltype == 'newest':
|
elif ltype == 'newest':
|
||||||
query = query.order_by(desc(Folder.created))
|
query = query.order_by(desc(Folder.created))
|
||||||
|
Loading…
Reference in New Issue
Block a user