mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +00:00
parent
27df94e578
commit
034a47d1d7
@ -69,7 +69,7 @@ def album_list():
|
|||||||
offset = int(offset) if offset else 0
|
offset = int(offset) if offset else 0
|
||||||
root = get_root_folder(mfid)
|
root = get_root_folder(mfid)
|
||||||
|
|
||||||
query = Track.select(Track.folder).join(Folder).group_by(Track.folder)
|
query = Folder.select().join(Track, on=Track.folder).switch().group_by(Folder.id)
|
||||||
if root is not None:
|
if root is not None:
|
||||||
query = query.where(Track.root_folder == root)
|
query = query.where(Track.root_folder == root)
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ def album_list():
|
|||||||
"albumList",
|
"albumList",
|
||||||
{
|
{
|
||||||
"album": [
|
"album": [
|
||||||
t.folder.as_subsonic_child(request.user)
|
f.as_subsonic_child(request.user)
|
||||||
for t in query.order_by(random()).limit(size)
|
for f in query.order_by(random()).limit(size)
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -101,7 +101,11 @@ def album_list():
|
|||||||
query = query.order_by(Folder.name)
|
query = query.order_by(Folder.name)
|
||||||
elif ltype == "alphabeticalByArtist":
|
elif ltype == "alphabeticalByArtist":
|
||||||
parent = Folder.alias()
|
parent = Folder.alias()
|
||||||
query = query.join(parent).order_by(parent.name, Folder.name)
|
query = (
|
||||||
|
query.join(parent)
|
||||||
|
.group_by_extend(parent.id)
|
||||||
|
.order_by(parent.name, Folder.name)
|
||||||
|
)
|
||||||
elif ltype == "byYear":
|
elif ltype == "byYear":
|
||||||
startyear = int(request.values["fromYear"])
|
startyear = int(request.values["fromYear"])
|
||||||
endyear = int(request.values["toYear"])
|
endyear = int(request.values["toYear"])
|
||||||
@ -122,8 +126,8 @@ def album_list():
|
|||||||
"albumList",
|
"albumList",
|
||||||
{
|
{
|
||||||
"album": [
|
"album": [
|
||||||
t.folder.as_subsonic_child(request.user)
|
f.as_subsonic_child(request.user)
|
||||||
for t in query.limit(size).offset(offset)
|
for f in query.limit(size).offset(offset)
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user