Small fixes to tags handling and cache invalidation

This commit is contained in:
Frisk 2024-09-10 16:11:18 +02:00
parent c6e9a92c94
commit 902cceadb0

View file

@ -407,7 +407,7 @@ class Wiki:
return request_json
async def fetch_wiki(self, amount=10) -> dict:
if self.mw_messages is None:
if self.mw_messages is None or self.recache_requested:
params = OrderedDict({"action": "query", "format": "json", "uselang": "content", "list": "tags|recentchanges",
"meta": "allmessages|siteinfo",
"utf8": 1, "tglimit": "max", "tgprop": "displayname",
@ -416,7 +416,7 @@ class Wiki:
"ammessages": "recentchanges-page-added-to-category|recentchanges-page-removed-from-category|recentchanges-page-added-to-category-bundled|recentchanges-page-removed-from-category-bundled",
"amenableparser": 1, "amincludelocal": 1, "siprop": "namespaces|general"})
else:
params = OrderedDict({"action": "query", "format": "json", "uselang": "content", "list": "tags|recentchanges",
params = OrderedDict({"action": "query", "format": "json", "uselang": "content", "list": "recentchanges",
"meta": "siteinfo", "utf8": 1, "rcshow": "!bot",
"rcprop": "title|redirect|timestamp|ids|loginfo|parsedcomment|sizes|flags|tags|user|userid",
"rclimit": amount, "rctype": "edit|new|log|categorize", "siprop": "namespaces|general"})