fix: bsky repost status

This commit is contained in:
xtaodada 2024-10-21 15:15:06 +08:00
parent e8e6b08372
commit fe78cf4006
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 4 additions and 5 deletions

View File

@ -82,8 +82,8 @@ class Timeline:
if (post.is_reply or post.is_quote) and post.parent_post: if (post.is_reply or post.is_quote) and post.parent_post:
text += f"{post.parent_post.author.format} {post.parent_post.status}{post.parent_post.time_str}\n" text += f"{post.parent_post.author.format} {post.parent_post.status}{post.parent_post.time_str}\n"
text += f"{post.author.format} {post.status}{post.time_str}\n" text += f"{post.author.format} {post.status}{post.time_str}\n"
if post.is_repost: if post.is_repost and post.repost_info:
text += f"{post.repost_info.by.format} {post.status}{post.repost_info.time_str}\n" text += f"{post.repost_info.by.format} 转发{post.repost_info.time_str}\n"
text += f"点赞: {post.like_count} | 引用: {post.quote_count} | 回复: {post.reply_count} | 转发: {post.repost_count}" text += f"点赞: {post.like_count} | 引用: {post.quote_count} | 回复: {post.reply_count} | 转发: {post.repost_count}"
return text return text

View File

@ -131,8 +131,6 @@ class HumanPost(BaseModel, frozen=False):
return "引用" return "引用"
elif self.is_reply: elif self.is_reply:
return "回复" return "回复"
elif self.is_repost:
return "转发"
return "发表" return "发表"
@staticmethod @staticmethod
@ -192,7 +190,8 @@ class HumanPost(BaseModel, frozen=False):
elif data.reason: elif data.reason:
is_repost = True is_repost = True
repost_info = HumanRepostInfo( repost_info = HumanRepostInfo(
by=HumanAuthor.parse(data.reason.by), at=data.reason.at by=HumanAuthor.parse(data.reason.by),
at=data.reason.indexed_at,
) )
elif data.post.embed and isinstance(data.post.embed, BskyViewRecord): elif data.post.embed and isinstance(data.post.embed, BskyViewRecord):
is_quote = True is_quote = True