dsfsfd
This commit is contained in:
parent
f6184e2c21
commit
2acfeec7ff
5 changed files with 21 additions and 7 deletions
|
@ -423,6 +423,21 @@ class User(Base):
|
|||
if "rama" in site: return f"https://{site}/assets/images/defaultpictures/{random.randint(1, 150)}.webp?v=1"
|
||||
return f"https://{site}/assets/images/default-profile-pic.webp"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def json_popover(self):
|
||||
data = {'username': self.username,
|
||||
'url': self.url,
|
||||
'profile_url': self.profile_url,
|
||||
'bannerurl': self.banner_url,
|
||||
'bio_html': self.bio_html_eager,
|
||||
'coins': self.coins,
|
||||
'post_count': self.post_count,
|
||||
'comment_count': self.comment_count,
|
||||
}
|
||||
|
||||
return data
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def json_raw(self):
|
||||
|
@ -462,7 +477,7 @@ class User(Base):
|
|||
data = self.json_core
|
||||
|
||||
data["badges"] = [x.json_core for x in self.badges]
|
||||
data['coins'] = int(self.coins)
|
||||
data['coins'] = self.coins
|
||||
data['post_count'] = self.post_count
|
||||
data['comment_count'] = self.comment_count
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue