Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,7 +104,7 @@ if 'access_token' in st.session_state:
|
|
| 104 |
df = pd.DataFrame([{
|
| 105 |
'name': activity.name,
|
| 106 |
'distance': float(activity.distance) if activity.distance is not None else 0,
|
| 107 |
-
'moving_time': activity.moving_time.total_seconds() / 3600 if activity.moving_time is not None else 0,
|
| 108 |
'elevation_gain': float(activity.total_elevation_gain) if activity.total_elevation_gain is not None else 0,
|
| 109 |
'type': str(activity.type),
|
| 110 |
'start_date': activity.start_date.replace(tzinfo=None) if activity.start_date is not None else None
|
|
|
|
| 104 |
df = pd.DataFrame([{
|
| 105 |
'name': activity.name,
|
| 106 |
'distance': float(activity.distance) if activity.distance is not None else 0,
|
| 107 |
+
'moving_time': activity.moving_time.total_seconds() / 3600 if isinstance(activity.moving_time, timedelta) else float(activity.moving_time) / 3600 if activity.moving_time is not None else 0,
|
| 108 |
'elevation_gain': float(activity.total_elevation_gain) if activity.total_elevation_gain is not None else 0,
|
| 109 |
'type': str(activity.type),
|
| 110 |
'start_date': activity.start_date.replace(tzinfo=None) if activity.start_date is not None else None
|