This commit is contained in:
Frisk 2020-08-16 15:01:16 +02:00
parent 27e6a79737
commit f6ecee6583
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
2 changed files with 7 additions and 1 deletions

View file

@ -312,6 +312,7 @@
"embed": {
"show_content": true
}
}
},
"show_forums": []
}
}

View file

@ -63,6 +63,11 @@ def fetch_discussions():
def parse_discussion_post(post):
"""Initial post recognition & handling"""
post_type = post["_embedded"]["thread"][0]["containerType"]
# Filter posts by forum
if post_type == "FORUM" and settings["fandom_discussions"].get("show_forums", []):
if not post["forumName"] in settings["fandom_discussions"]["show_forums"]:
discussion_logger.debug(f"Ignoring post as it's from {post['forumName']}.")
return
formatter(post_type, post)