Private
Public Access
1
0

got team upload working

This commit is contained in:
2025-10-22 14:12:03 +02:00
parent 6ca40ad6ba
commit c76334c50a
7 changed files with 104 additions and 285 deletions

View File

@@ -3,6 +3,7 @@ from rowers.utils import myqueue
import zipfile
import os
from rowingdata import get_file_type
from rowingdata import rowingdata as rrdata
import django_rq
from shutil import copyfile
from time import strftime
@@ -179,7 +180,7 @@ def unzip_and_process(zip_filepath, uploadoptions, parent_job_id, debug=False, *
for id, filename in enumerate(zip_ref.namelist()):
datafile = zip_ref.extract(filename, path='media/')
if id > 0:
uploadoptions['title'] = uploadoptions['title'] + " Part {id+1}".format(id=id)
uploadoptions['title'] = uploadoptions['title'] + " Part {id}".format(id=id)
uploadoptions['file'] = datafile
job_id = generate_job_id()
_ = myqueue(
@@ -231,9 +232,12 @@ def check_and_fix_samplerate(row, file_path):
return row, file_path
def is_water_rowing(df):
lat = df[' latitude']
if lat.mean() != 0 and lat.std() != 0:
return True
try:
lat = df[' latitude']
if lat.mean() != 0 and lat.std() != 0:
return True
except KeyError:
return False
def remove_negative_power_peaks(row):
x = row.df[' Power (watts)'].values
@@ -686,7 +690,7 @@ def process_single_file(file_path, uploadoptions, job_id, debug=False, **kwargs)
uploads.do_sync(w, uploadoptions, quick=True)
return True
return True, f2