mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
add item counts
This commit is contained in:
+3
-3
@@ -123,15 +123,13 @@ def get_folder_tree(body: FolderTree):
|
||||
reverse=True,
|
||||
)
|
||||
|
||||
for playlist in playlists:
|
||||
playlist.clear_lists()
|
||||
|
||||
return {
|
||||
"path": req_dir,
|
||||
"folders": [
|
||||
{
|
||||
"name": p.name,
|
||||
"path": f"$playlist/{p.id}",
|
||||
"trackcount": p.count,
|
||||
}
|
||||
for p in playlists
|
||||
],
|
||||
@@ -172,11 +170,13 @@ def get_folder_tree(body: FolderTree):
|
||||
playlists_item = {
|
||||
"name": "Playlists",
|
||||
"path": "$playlists",
|
||||
"trackcount": sum(p.count for p in PlaylistTable.get_all()),
|
||||
}
|
||||
|
||||
favorites_item = {
|
||||
"name": "Favorites",
|
||||
"path": "$favorites",
|
||||
"trackcount": FavoritesTable.get_fav_tracks(0, -1)[1],
|
||||
}
|
||||
|
||||
results["folders"].insert(0, playlists_item)
|
||||
|
||||
Reference in New Issue
Block a user