diff --git a/main.py b/main.py index aad105c..6ac0ffd 100644 --- a/main.py +++ b/main.py @@ -63,8 +63,16 @@ def process_gpx_files(tx: Connection, owner: str): if gpx_file.creator != 'FitoTrack': raise ValueError('gpx file not generated by the FitoTrack app') training_id = list(db.execute( - 'insert into training (owner, filename, medium, description) values (:owner, :filename, :medium, :description) returning id', - (owner, filename, ) + """insert into training (owner, filename, medium, description, moving_time, stopped_time, moving_distance, stopped_distance) values + (?, ?, ?, ?, ?, ?, ?, ?) returning id""", + (owner, + filename, + "", + gpx_file.description, + gpx_file.get_moving_data().moving_time, + gpx_file.get_moving_data().stopped_time, + gpx_file.get_moving_data().moving_distance, + gpx_file.get_moving_data().stopped_distance,) ))[0][0]