getting intervals_import working
This commit is contained in:
@@ -42,7 +42,12 @@ from rowers import uploads
|
||||
|
||||
from rowingdata import rower as rrower
|
||||
|
||||
from rowers.dataroutines import rdata, get_startdate_time_zone, df_resample, checkduplicates, dataplep
|
||||
from rowers.dataroutines import (
|
||||
rdata, get_startdate_time_zone, df_resample, checkduplicates, dataplep,
|
||||
get_workouttype_from_fit,
|
||||
get_title_from_fit,
|
||||
get_notes_from_fit,
|
||||
)
|
||||
from rowers.mytypes import otetypes, otwtypes
|
||||
from rowers.utils import totaltime_sec_to_string
|
||||
from rowers.dataprep import check_marker, checkbreakthrough, update_wps, handle_nonpainsled
|
||||
@@ -299,7 +304,7 @@ def update_workout_attributes(w, row, file_path, uploadoptions,
|
||||
)
|
||||
|
||||
boattype = uploadoptions.get('boattype', '1x')
|
||||
workoutsource = 'unknown'
|
||||
workoutsource = uploadoptions.get('workoutsource', 'unknown')
|
||||
stravaid = uploadoptions.get('stravaid', 0)
|
||||
rpe = uploadoptions.get('rpe', 0)
|
||||
notes = uploadoptions.get('notes', '')
|
||||
@@ -349,6 +354,8 @@ def update_workout_attributes(w, row, file_path, uploadoptions,
|
||||
|
||||
if uploadoptions.get('summary', '') == '':
|
||||
summary = row.allstats()
|
||||
else:
|
||||
summary = uploadoptions.get('summary', '')
|
||||
|
||||
if uploadoptions.get('makeprivate', False):
|
||||
privacy = 'hidden'
|
||||
@@ -567,6 +574,12 @@ def process_single_file(file_path, uploadoptions, job_id, debug=False, **kwargs)
|
||||
f2,
|
||||
fileformat,
|
||||
)
|
||||
uploadoptions['summary'] = summary
|
||||
uploadoptions['oarlength'] = oarlength
|
||||
uploadoptions['inboard'] = inboard
|
||||
uploadoptions['useImpeller'] = impeller
|
||||
if uploadoptions['workouttype'] != 'strave':
|
||||
uploadoptions['workoutsource'] = fileformat
|
||||
if not f2:
|
||||
return {
|
||||
"status": "error",
|
||||
@@ -624,7 +637,7 @@ def process_single_file(file_path, uploadoptions, job_id, debug=False, **kwargs)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
workoutid = uploadoptions.get('workoutid', None)
|
||||
workoutid = uploadoptions.get('id', None)
|
||||
if workoutid is not None:
|
||||
try:
|
||||
w = Workout.objects.get(id=workoutid)
|
||||
@@ -679,7 +692,7 @@ def process_single_file(file_path, uploadoptions, job_id, debug=False, **kwargs)
|
||||
r.ftp, r.sex, r.hrftp, r.max, r.rest, wps_avg)
|
||||
|
||||
# make plots
|
||||
if uploadoptions['make_plot']:
|
||||
if uploadoptions.get('makeplot', False):
|
||||
plottype = uploadoptions.get('plottype', 'timeplot')
|
||||
res, jobid = uploads.make_plot(r, w, f1, f2, plottype, w.name)
|
||||
elif r.staticchartonupload != 'None': # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user