mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-22 00:44:10 +00:00
Fix discussion issue for new wikis in the feed
This commit is contained in:
parent
fbfa5a1e49
commit
a4d9aab979
|
@ -454,6 +454,8 @@ async def discussion_handler():
|
||||||
except:
|
except:
|
||||||
logger.exception("On loading json of response.")
|
logger.exception("On loading json of response.")
|
||||||
continue
|
continue
|
||||||
|
if isinstance(discussion_feed, list) and any(discussion_feed) is False:
|
||||||
|
continue
|
||||||
if db_wiki["postid"] is None: # new wiki, just get the last post to not spam the channel
|
if db_wiki["postid"] is None: # new wiki, just get the last post to not spam the channel
|
||||||
if len(discussion_feed) > 0:
|
if len(discussion_feed) > 0:
|
||||||
DBHandler.add(db_wiki["wiki"], discussion_feed[-1]["id"], True)
|
DBHandler.add(db_wiki["wiki"], discussion_feed[-1]["id"], True)
|
||||||
|
@ -463,8 +465,6 @@ async def discussion_handler():
|
||||||
continue
|
continue
|
||||||
comment_events = []
|
comment_events = []
|
||||||
targets = await generate_targets(db_wiki["wiki"], "AND NOT postid = '-1'")
|
targets = await generate_targets(db_wiki["wiki"], "AND NOT postid = '-1'")
|
||||||
if isinstance(discussion_feed, list) and any(discussion_feed) is False:
|
|
||||||
continue
|
|
||||||
for post in discussion_feed:
|
for post in discussion_feed:
|
||||||
if post["_embedded"]["thread"][0]["containerType"] == "ARTICLE_COMMENT" and post["id"] > db_wiki["postid"]:
|
if post["_embedded"]["thread"][0]["containerType"] == "ARTICLE_COMMENT" and post["id"] > db_wiki["postid"]:
|
||||||
comment_events.append(post["forumId"])
|
comment_events.append(post["forumId"])
|
||||||
|
|
Loading…
Reference in a new issue