Skip to content

Commit

Permalink
fix: xingzhe start_time_local
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-29 committed May 21, 2024
1 parent 182fc0b commit 07fbe13
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions run_page/gpxtrackposter/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,11 @@ def _load_gpx_data(self, gpx):
# determinate source
if gpx.creator:
self.source = gpx.creator
elif gpx.tracks[0].source:
if gpx.tracks[0].source:
self.source = gpx.tracks[0].source
if self.source == "xingzhe":
self.start_time_local = self.start_time
self.end_time_local = self.end_time
self.run_id = gpx.tracks[0].number
# determinate name
if gpx.name:
Expand Down Expand Up @@ -240,9 +241,10 @@ def _load_gpx_data(self, gpx):
self.start_latlng = start_point(*polyline_container[0])
except:
pass
self.start_time_local, self.end_time_local = parse_datetime_to_local(
self.start_time, self.end_time, polyline_container[0]
)
if not self.start_time_local:
self.start_time_local, self.end_time_local = parse_datetime_to_local(
self.start_time, self.end_time, polyline_container[0]
)
self.polyline_str = polyline.encode(polyline_container)
self.average_heartrate = (
sum(heart_rate_list) / len(heart_rate_list) if heart_rate_list else None
Expand Down

0 comments on commit 07fbe13

Please sign in to comment.