adding resampling on demand, untested
This commit is contained in:
@@ -101,7 +101,16 @@ class IntervalsIntegration(SyncIntegration):
|
||||
|
||||
def createworkoutdata(self, w, *args, **kwargs) -> str:
|
||||
dozip = kwargs.get('dozip', True)
|
||||
filename = w.csvfilename
|
||||
# resample if wanted by user, not tested
|
||||
if w.user.intervals_resample_to_1s:
|
||||
datadf, id, msgs = dataprep.resample(
|
||||
w.id, w.user, w, overwrite=False
|
||||
)
|
||||
w_resampled = Workout.objects.get(id=id)
|
||||
filename = w_resampled.csvfilename
|
||||
else:
|
||||
w_resampled = None
|
||||
filename = w.csvfilename
|
||||
try:
|
||||
row = rowingdata(csvfile=filename)
|
||||
except IOError: # pragma: no cover
|
||||
@@ -128,6 +137,8 @@ class IntervalsIntegration(SyncIntegration):
|
||||
except TypeError:
|
||||
newnotes = 'from'+w.workoutsource+' via rowsandall.com'
|
||||
|
||||
if w.user.intervals_resample_to_1s and w_resampled:
|
||||
w_resampled.delete()
|
||||
row.exporttotcx(tcxfilename, notes=newnotes, sport=mytypes.intervalsmapping[w.workouttype])
|
||||
if dozip:
|
||||
gzfilename = tcxfilename + '.gz'
|
||||
|
||||
Reference in New Issue
Block a user