mirror of
https://github.com/spl0k/supysonic.git
synced 2024-11-09 19:52:16 +00:00
Genre related fixes
Fix /getGenres for DBMSs other tha SQLite Don't list an empty genre Ref #241
This commit is contained in:
parent
ad688a23c3
commit
d5a4f1856c
@ -139,8 +139,9 @@ def list_genres():
|
||||
"genre": [
|
||||
{"value": genre, "songCount": sc, "albumCount": ac}
|
||||
for genre, sc, ac in Track.select(
|
||||
Track.genre, fn.count(), fn.count(Track.album.distinct())
|
||||
Track.genre, fn.count("*"), fn.count(Track.album.distinct())
|
||||
)
|
||||
.where(Track.genre.is_null(False))
|
||||
.group_by(Track.genre)
|
||||
.tuples()
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user