svthalia / concrexit

Thalia Website built on Django.
https://thalia.nu
Other
22 stars 12 forks source link

"Download all my photos"-button for face detection #3173

Open JobDoesburg opened 1 year ago

JobDoesburg commented 1 year ago

Is your feature request related to a problem? Please describe.

I want to download all photos of me

Describe the solution you'd like

A "Download all my photos"-button

Motivation

Describe alternatives you've considered

Additional context

DeD1rk commented 1 year ago

This would be really nice to have. There's also #2770.

I think we could tackle both of them by writing an AWS Lambda that zips a list of s3 objects, and saves it to S3. The original problems for #2770 then no longer apply.

I think it would be nice to keep track of those archives with a model, for zipped albums as well as face detection photos. Then we can:

We could keep track of the exact files that need to be included in an archive by hashing the photos (filenames or even content hashes), and storing that on the zip model. It's really easy and efficient to check whether the stored archive is up to date.

For the UI, when an up-to-date archive already exists, a link to that can just be rendered. For facedetection if an archive doesn't exist yet, we can have JS do an API call to trigger the creation, and either poll until it's done, or have a slow hanging response if we await for lambda completion in the response cycle.

DeD1rk commented 1 year ago

https://www.antstack.com/blog/create-zip-using-lambda-with-files-streamed-from-s3/ for some inspiration for a lambda