mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 17:06: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
|
pass
|
||||||
|
|
||||||
avgRating = (
|
avgRating = (
|
||||||
RatingFolder.select(fn.avg(RatingFolder.rating))
|
RatingFolder.select(fn.avg(RatingFolder.rating, coerce=False))
|
||||||
.where(RatingFolder.rated == self)
|
.where(RatingFolder.rated == self)
|
||||||
.scalar()
|
.scalar()
|
||||||
)
|
)
|
||||||
@ -343,7 +343,7 @@ class Track(PathMixin, _Model):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
avgRating = (
|
avgRating = (
|
||||||
RatingTrack.select(fn.avg(RatingTrack.rating))
|
RatingTrack.select(fn.avg(RatingTrack.rating, coerce=False))
|
||||||
.where(RatingTrack.rated == self)
|
.where(RatingTrack.rated == self)
|
||||||
.scalar()
|
.scalar()
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user