Merge branch 'pr/244' into 0.13.0

This commit is contained in:
João Vitória Silva
2025-07-14 17:23:02 +01:00
3 changed files with 8 additions and 4 deletions

View File

@@ -12,3 +12,4 @@ ENDURAIN_HOST=https://endurain.example.com
BEHIND_PROXY=true
POSTGRES_DB=endurain
POSTGRES_USER=endurain
PGDATA=/var/lib/postgresql/data/pgdata

View File

@@ -46,6 +46,7 @@ def parse_gpx_file(
avg_speed = None
max_speed = None
activity_name = "Workout"
activity_description = None
process_one_time_fields = 0
gear_id = None
@@ -81,8 +82,9 @@ def parse_gpx_file(
if gpx.tracks:
# Iterate over tracks in the GPX file
for track in gpx.tracks:
# Set activity name and type if available
activity_name = track.name if track.name else "Workout"
# Set activity name, description, and type if available
activity_name = track.name if track.name else gpx.name if gpx.name else "Workout"
activity_description = track.description if track.description else gpx.description if gpx.description else None
activity_type = track.type if track.type else "Workout"
if track.segments:
@@ -286,6 +288,7 @@ def parse_gpx_file(
activity = activities_schema.Activity(
user_id=user_id,
name=activity_name,
description=activity_description,
distance=round(distance) if distance else 0,
activity_type=activity_type,
start_time=first_waypoint_time.strftime("%Y-%m-%dT%H:%M:%S"),

View File

@@ -53,12 +53,12 @@ Splitting up the setup like this make it easy to handle updates to the container
To make it as easy as possible for selfhoster to get up and running examples of docker-compose.yml and .env is on the git repo. Here are links to the files on the repo:
* [docker-compose.yml.example](https://raw.githubusercontent.com/joaovitoriasilva/endurain/refs/heads/master/docker-compose.yml.example)
* [.env.example](https://raw.githubusercontent.com/joaovitoriasilva/endurain/refs/heads/master/env.example)
* [.env.example](https://raw.githubusercontent.com/joaovitoriasilva/endurain/refs/heads/master/.env.example)
```bash
cd /opt/endurain
wget https://raw.githubusercontent.com/joaovitoriasilva/endurain/refs/heads/master/docker-compose.yml.example
wget https://raw.githubusercontent.com/joaovitoriasilva/endurain/refs/heads/master/env.example
wget https://raw.githubusercontent.com/joaovitoriasilva/endurain/refs/heads/master/.env.example
mv docker-compose.yml.example docker-compose.yml
mv .env.example .env