Update setu.py

This commit is contained in:
HibiKier 2021-09-09 18:16:15 +08:00 committed by GitHub
parent 8ac440335e
commit 00b674cebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,7 @@ class Setu(db.Model):
flag = False if r18 == 0 else True
setattr(Setu, 'count', db.func.count(cls.local_id).label('count'))
count = await cls.select('count').where(cls.is_r18 == flag).gino.first()
return count
return count[0]
@classmethod
async def get_image_in_hash(cls, img_hash: str) -> "Setu":