Improve upload API

To ease integrations (and especially for the mobile app and website), it would be nice to improve the upload API.

I think we should be able to handle at least the same thing as the CLI:

  1. recovery when an uploaded has been stopped
  2. duplicate detection
  3. split in sequence for too far in space time pictures
  4. remove pictures not interesting (like when stopped at a traffic light)

I'm not sure we must handle all those use cases, especially at first.

How can we do this?

The challenge will be to try avoiding useless pictures if possible.

Here are some ideas, and maybe we can combine some.

pre upload step

We could add an optional step before uploading picture, and the client could send a list of metadata on the picture that will be sent (maybe with their names and some hash?), and the api could return if some pictures are already there. It would work for 1. and maybe 2. but for 3. and 4. it would be impossible without pictures metadata, and even with this, I'm not sure it would be a nice interface to dispatch the pictures to several sequences for 3.

New upload api

Maybe we could add a new upload api without a collection, something like /api/users/upload and the API would dispatch the pictures to sequences.

But this way of doing would be harder to implement API side, and I'm not really sure we can always be able to know how to group the pictures.

have another concept beside sequence/collection?

I'm not really sure about this one, but maybe we need different concepts besides sequence? I feel sequences are used for 2 main stuff:

  • have an easy way to organize the uploaded pictures for the owner
  • have a way to 'play' a route and see all its pictures.

do I miss others?

maybe having 2 concepts for them would make it easier to handle both cases?

I have other ideas, but I think it would be easier to talk about them directly