]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Fix detecting entries under construction.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Sat, 21 May 2022 14:05:41 +0000 (16:05 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Sat, 21 May 2022 14:05:41 +0000 (16:05 +0200)
bots/sledrun_wikitext_to_json.py

index ddbc8ebc32171e5e25bf4f28cbfb36eeb42e670a..83590dad94a4646d89476f026f30d3a11c244e56 100644 (file)
@@ -96,6 +96,9 @@ class SledrunWikiTextToJsonBot(
 
         sledrun_json_page = Page(self.site, self.current_page.title() + '/Rodelbahn.json')
 
+        if sledrun_json_page.exists():  # should be an option
+            return
+
         map_json_page = Page(self.site, self.current_page.title() + '/Landkarte.json')
 
         map_json = None
@@ -106,7 +109,7 @@ class SledrunWikiTextToJsonBot(
         sledrun_json = {
             "name": self.current_page.title(),
             "aliases": [],
-            "entry_under_construction": sum(1 for c in wikilink_list if c.text == 'Kategorie:In Arbeit') > 0,
+            "entry_under_construction": sum(1 for c in wikilink_list if c.title == 'Kategorie:In Arbeit') > 0,
         }
 
         optional_set(sledrun_json, 'description', get_sledrun_description(wikicode))