Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide another way to upload all kinds of sport type of TCX file to … #666

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion run_page/oppo_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def get_all_oppo_tracks(
)
tracks.append(track)
except Exception as e:
print(f"Something wrong paring keep id {str(start)}-{str(end)}" + str(e))
print(f"Something wrong paring keep id {str(start)}-{str(end)}, " + str(e))
return tracks


Expand Down Expand Up @@ -408,6 +408,10 @@ def prepare_track_points(sport_data, with_gpx):

for i in range(value_size):
temp_timestamp = other_data.get("gpsPoint")[i]["timestamp"]

if temp_timestamp not in timestamp_list:
continue

j = timestamp_list.index(temp_timestamp)

points_dict = {
Expand Down
2 changes: 1 addition & 1 deletion run_page/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def get_strava_last_time(client, is_milliseconds=True):
return 0


def upload_file_to_strava(client, file_name, data_type, force_to_run=True):
def upload_file_to_strava(client, file_name, data_type, force_to_run=False):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default force_to_run shouldn't be changed here, as it will affect features like Garmin, Keep, and Nike.
Just change the param in tcx_to_strava_sync.

Or just keep this unchanged, since this repo is mainly for running.

I'll change the force_to_run=False in workouts_page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I see

with open(file_name, "rb") as f:
try:
if force_to_run:
Expand Down