Opened 4 years ago

Closed 3 years ago

#77 closed task (fixed)

Bulk workouts upload

Reported by: borja Owned by: borja
Priority: major Milestone: OpenWorkouts 0.3
Component: workouts Keywords:
Cc:

Description

So, we already have some code to add workouts in batch mode from a local directory on the filesystem (browser:OpenWorkouts-current/ow/load_workouts.py), but that works only if the workout files (gpx, fit) are located in the filesystem of the computer where openworkouts is running on. In the case of running it in a separate server, users don't have an easy way to upload those workouts.

The idea would be to allow users to upload a compressed file containing all the workout files, like a zip, tgz, 7z, etc.

Then, openworkouts should uncompress that file into a temporary destination, and run our load_workouts code from there (in a separate, background, process of course).

One obvious problem of that is that those compressed files could be quite big, which usually don't work well with traditional http file uploads. One solution for that would be to use something like this js library:

http://www.resumablejs.com

Change History (5)

comment:1 Changed 3 years ago by borja

  • Owner set to borja
  • Status changed from new to accepted

comment:2 Changed 3 years ago by borja

TODO-like list for this ticket:

  1. Add a view to handle compressed files upload. Those files should be saved somewhere on the filesystem, associated with the user that uploaded them. Once uploaded, a message is shown to the user, telling him that workouts will be loaded soon.
  1. Add a task to look for (new) compressed files, for any file found, uncompress it in a temporary directory, then call our load_workouts code on that directory. This task will have to be aware of who uploaded that compressed file, to add the workouts to the proper user. Important: load_workouts should take care of duplicated uploads too
  1. Add some code to the load_workouts module that saves some kind of a "report" with information about which workouts have been added from the load of that compressed file. That report should be kept around somewhere, so the user can go back and check which workouts were added when loading that compressed file (maybe we can have a button in the user profile page bulk upload reports which loads a view showing the names of those compressed files uploaded and the relation with the uploaded workouts.
  1. (enhancement) While the user has workouts pending to be added from that bulk upload, show in the UI (header? alert-like visible everywhere? we need a good idea here) telling him/her something like workouts loading: 3/10 or even a small progress bar.
  1. (enhancement) For now, we will pick up only fit/gpx files from the compressed file. This has the "drawback" that users cannot provide title/description/etc for each workout. Which is ok, as they can edit them afterwards, but we could accept a metadata file in the compressed file, where users could tell us basic info like title/descr for each workout. Then our code from load_workouts should look for that file and use it when adding those workouts.
Last edited 3 years ago by borja (previous) (diff)

comment:3 Changed 3 years ago by borja

  • Milestone changed from OpenWorkouts 0.5 to OpenWorkouts 0.3

comment:4 Changed 3 years ago by borja

Implemented here:

This implementation do not address the issue with big file uploads, I think it is best to move that out to a ticket on its own (see ticket #85).

Last edited 3 years ago by borja (previous) (diff)

comment:5 Changed 3 years ago by borja

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.