mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
fix formatting fix
This commit is contained in:
parent
e0d0350007
commit
d729e0bc23
|
@ -80,6 +80,7 @@ async def feeds_embed_formatter(post_type, post, message_target, wiki, article_p
|
||||||
embed["description"] = embed["description"].replace(npost.image_last, "")
|
embed["description"] = embed["description"].replace(npost.image_last, "")
|
||||||
else: # Fallback when model is not available
|
else: # Fallback when model is not available
|
||||||
embed["description"] = post.get("rawContent", "")
|
embed["description"] = post.get("rawContent", "")
|
||||||
|
if post["forumName"] is not None:
|
||||||
embed["footer"]["text"] = post["forumName"].replace("_", " ")
|
embed["footer"]["text"] = post["forumName"].replace("_", " ")
|
||||||
embed["timestamp"] = datetime.datetime.fromtimestamp(post["creationDate"]["epochSecond"], tz=datetime.timezone.utc).isoformat()
|
embed["timestamp"] = datetime.datetime.fromtimestamp(post["creationDate"]["epochSecond"], tz=datetime.timezone.utc).isoformat()
|
||||||
if post_type == "FORUM":
|
if post_type == "FORUM":
|
||||||
|
@ -126,7 +127,7 @@ async def feeds_embed_formatter(post_type, post, message_target, wiki, article_p
|
||||||
elif post_type == "WALL":
|
elif post_type == "WALL":
|
||||||
user_wall = _("unknown") # Fail safe
|
user_wall = _("unknown") # Fail safe
|
||||||
if post["forumName"].endswith(' Message Wall'):
|
if post["forumName"].endswith(' Message Wall'):
|
||||||
user_wall = post["forumName"][:-13]
|
user_wall = post["forumName"][:-13].replace("_", " ")
|
||||||
if not post["isReply"]:
|
if not post["isReply"]:
|
||||||
embed.event_type = "discussion/wall/post"
|
embed.event_type = "discussion/wall/post"
|
||||||
embed["url"] = "{url}wiki/Message_Wall:{user_wall}?threadId={threadId}".format(url=wiki, user_wall=quote_plus(user_wall.replace(" ", "_")), threadId=post["threadId"])
|
embed["url"] = "{url}wiki/Message_Wall:{user_wall}?threadId={threadId}".format(url=wiki, user_wall=quote_plus(user_wall.replace(" ", "_")), threadId=post["threadId"])
|
||||||
|
|
Loading…
Reference in a new issue