From f6ecee65834a7432fc1d7c7e41456da6053023ef Mon Sep 17 00:00:00 2001 From: Frisk Date: Sun, 16 Aug 2020 15:01:16 +0200 Subject: [PATCH] Added #121 --- settings.json.example | 3 ++- src/discussions.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/settings.json.example b/settings.json.example index c63c2c6..3f9d959 100644 --- a/settings.json.example +++ b/settings.json.example @@ -312,6 +312,7 @@ "embed": { "show_content": true } - } + }, + "show_forums": [] } } diff --git a/src/discussions.py b/src/discussions.py index e549c91..83684a2 100644 --- a/src/discussions.py +++ b/src/discussions.py @@ -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)