pingvin-share icon indicating copy to clipboard operation
pingvin-share copied to clipboard

feat(Share): Generate zip file on the fly

Open aarondoet opened this issue 1 year ago • 9 comments

Goal of this PR is to no longer generate zip files for all shares by default but rather generate them on the fly when a download is requested. The only reason for this to generate overhead over someone downloading the files one by one would be the compression - which one could get rid of.

aarondoet avatar Jan 01 '25 17:01 aarondoet

Not completely finished yet, need to remove the zip generation and saving on upload and the isZipReady property. I have tested this already though, the API now generates the zip file when requested.

aarondoet avatar Jan 01 '25 17:01 aarondoet

Would this also apply for the S3 storage option? As currently the S3 storage doesn't have the ZIP functionality.

adriaanh avatar Jan 07 '25 16:01 adriaanh

I would assume that this should also work with S3. However I never used S3 and don't intend to, so I won't be able to verify.

aarondoet avatar Jan 07 '25 22:01 aarondoet

  1. I now always show the Download All button, even if there is just one file. That makes the UI consistent and because the ZIP can now also be generated for single files I don't see a reason not to do it. This is personal preference however, I can undo this change again.
  2. The ZIP is now generated every time it is downloaded meaning the compression is also done every time. Personally I'd just remove the compression setting (not yet done though), with compression level 0 the ZIP generation only has negligible overhead compared to just downloading each file.

@stonith404 can you give me some input on this?

aarondoet avatar Jan 08 '25 15:01 aarondoet

Is it enough to remove the translation keys for english and Crowdin will remove it for the others as well or do you have to remove them all manually?

aarondoet avatar Jan 08 '25 15:01 aarondoet

I would assume that this should also work with S3. However I never used S3 and don't intend to, so I won't be able to verify.

There is probably a way but I'm not using S3 as well so someone else would have to contribute to support S3.

I now always show the Download All button, even if there is just one file. That makes the UI consistent and because the ZIP can now also be generated for single files I don't see a reason not to do it. This is personal preference however, I can undo this change again.

Yeah that makes sense.

The ZIP is now generated every time it is downloaded meaning the compression is also done every time. Personally I'd just remove the compression setting (not yet done though), with compression level 0 the ZIP generation only has negligible overhead compared to just downloading each file.

Yes we can do that. If anyone misses the compression feature, they can submit a feature request, and we can consider reintroducing it.

Is it enough to remove the translation keys for english and Crowdin will remove it for the others as well or do you have to remove them all manually?

Crowdin will remove the strings from the other files.

stonith404 avatar Jan 09 '25 14:01 stonith404

Hello, I am very interested in this PR as I am using S3 and for now when we click on the "Download all" button, we get a "Bad Request" error.

Is there anything I can help with to implement this to the S3 service in this PR ?

Thanks !

lucienbl avatar Feb 13 '25 08:02 lucienbl

@lucienbl, my PR adds that ;) #822

thereis avatar May 02 '25 19:05 thereis

@lucienbl, my PR adds that ;) #822

I saw that, thanks !! Works great ! 👍😊

lucienbl avatar May 02 '25 19:05 lucienbl