From fb3929f2f8eeeb4dcde4e51b2c9fdb3e5d2e8cb5 Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Sun, 17 Dec 2023 14:45:57 +0100 Subject: [PATCH] Add walkup time to exported columns. --- scripts/query_sledrun_list.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/query_sledrun_list.py b/scripts/query_sledrun_list.py index ca39346..f9fb40d 100644 --- a/scripts/query_sledrun_list.py +++ b/scripts/query_sledrun_list.py @@ -52,6 +52,7 @@ def create_sledrun_list(connection: Connection, api_url: str): "JSON_EXTRACT(sledrun_json, '$.position.longitude') as latitude, " \ "JSON_EXTRACT(sledrun_json, '$.position.latitude') as longitude, " \ "JSON_EXTRACT(sledrun_json, '$.length') as length, " \ + "JSON_EXTRACT(sledrun_json, '$.walkup_time') as walkup_time, " \ "JSON_EXTRACT(sledrun_json, '$.entry_under_construction') as under_construction, " \ "page_title as title " \ "FROM wrsledrunjsoncache JOIN page ON sledrun_page_id=page_id " \ @@ -59,11 +60,11 @@ def create_sledrun_list(connection: Connection, api_url: str): rows = connection.execute(sql) writer = csv.writer(sys.stdout, lineterminator='\n') - writer.writerow(['Name', 'Length', 'Longitude', 'Latitude', 'InArbeit', 'Url']) + writer.writerow(['Name', 'Length', 'WalkupTime', 'Longitude', 'Latitude', 'InArbeit', 'Url']) for row in rows: title = row['title'].decode('utf-8') url = urllib.parse.urljoin(api_url, title) - writer.writerow([json.loads(row['name']), row['length'], row['latitude'], row['longitude'], row['under_construction'], url]) + writer.writerow([json.loads(row['name']), row['length'], row['walkup_time'], row['latitude'], row['longitude'], row['under_construction'], url]) def query_sledrun_list(inifiles: List[str]): -- 2.39.5