mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
fix to #248, additional critical bugfixing
This commit is contained in:
parent
822d810056
commit
27f00cdfbb
|
@ -29,6 +29,7 @@ from src.exceptions import ArticleCommentError, NoFormatter
|
||||||
from src.api.util import default_message
|
from src.api.util import default_message
|
||||||
from src.api.context import Context
|
from src.api.context import Context
|
||||||
from src.api.hooks import formatter_hooks, pre_hooks, post_hooks
|
from src.api.hooks import formatter_hooks, pre_hooks, post_hooks
|
||||||
|
from src.i18n import formatters_i18n
|
||||||
|
|
||||||
|
|
||||||
# Create a custom logger
|
# Create a custom logger
|
||||||
|
@ -56,6 +57,7 @@ def inject_client(client_obj):
|
||||||
"""Function to avoid circular import issues"""
|
"""Function to avoid circular import issues"""
|
||||||
global client
|
global client
|
||||||
client = client_obj
|
client = client_obj
|
||||||
|
client.schedule(fetch_discussions, every=settings["fandom_discussions"]["cooldown"])
|
||||||
|
|
||||||
|
|
||||||
def fetch_discussions():
|
def fetch_discussions():
|
||||||
|
@ -107,7 +109,7 @@ def parse_discussion_post(post, comment_pages):
|
||||||
"""Initial post recognition & handling"""
|
"""Initial post recognition & handling"""
|
||||||
global client
|
global client
|
||||||
post_type = post["_embedded"]["thread"][0]["containerType"]
|
post_type = post["_embedded"]["thread"][0]["containerType"]
|
||||||
context = Context(display_mode, "discussion", webhook_url, client)
|
context = Context(display_mode, "discussion", webhook_url, client, formatters_i18n, settings)
|
||||||
# Filter posts by forum
|
# Filter posts by forum
|
||||||
if post_type == "FORUM" and settings["fandom_discussions"].get("show_forums", []):
|
if post_type == "FORUM" and settings["fandom_discussions"].get("show_forums", []):
|
||||||
if not post["forumName"] in settings["fandom_discussions"]["show_forums"]:
|
if not post["forumName"] in settings["fandom_discussions"]["show_forums"]:
|
||||||
|
@ -157,6 +159,3 @@ def safe_request(url) -> Optional[requests.Response]:
|
||||||
return None
|
return None
|
||||||
return request
|
return request
|
||||||
|
|
||||||
|
|
||||||
client.schedule(fetch_discussions, every=settings["fandom_discussions"]["cooldown"])
|
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ def abuselog_processing(entry):
|
||||||
action = "abuselog"
|
action = "abuselog"
|
||||||
if action in settings["ignored"]:
|
if action in settings["ignored"]:
|
||||||
return
|
return
|
||||||
context = Context(settings["appearance"]["mode"], "abuselog", settings["webhookURL"], client)
|
context = Context(settings["appearance"]["mode"], "abuselog", settings["webhookURL"], client, formatters_i18n, settings)
|
||||||
context.event = action
|
context.event = action
|
||||||
run_hooks(pre_hooks, context, entry)
|
run_hooks(pre_hooks, context, entry)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue