mirror of
https://github.com/spl0k/supysonic.git
synced 2024-11-12 21:22:17 +00:00
Fix average ratings for peewee pre-3.15.4
This commit is contained in:
parent
e51abfe80f
commit
f6b859d11f
@ -127,7 +127,7 @@ class Folder(PathMixin, _Model):
|
||||
pass
|
||||
|
||||
avgRating = (
|
||||
RatingFolder.select(fn.avg(RatingFolder.rating))
|
||||
RatingFolder.select(fn.avg(RatingFolder.rating, coerce=False))
|
||||
.where(RatingFolder.rated == self)
|
||||
.scalar()
|
||||
)
|
||||
@ -343,7 +343,7 @@ class Track(PathMixin, _Model):
|
||||
pass
|
||||
|
||||
avgRating = (
|
||||
RatingTrack.select(fn.avg(RatingTrack.rating))
|
||||
RatingTrack.select(fn.avg(RatingTrack.rating, coerce=False))
|
||||
.where(RatingTrack.rated == self)
|
||||
.scalar()
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user