-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Share): Generate zip file on the fly #727
base: main
Are you sure you want to change the base?
Conversation
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. |
Would this also apply for the S3 storage option? As currently the S3 storage doesn't have the ZIP functionality. |
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. |
Also render button when there is only one file. I prefer this for the sake of consistency, this could be removed again because it basically is unnecessary.
@stonith404 can you give me some input on this? |
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? |
There is probably a way but I'm not using S3 as well so someone else would have to contribute to support S3.
Yeah that makes sense.
Yes we can do that. If anyone misses the compression feature, they can submit a feature request, and we can consider reintroducing it.
Crowdin will remove the strings from the other files. |
const storageService = this.getStorageService(); | ||
return storageService.getZip(shareId) as Readable; | ||
async getZip(shareId: string) { | ||
const passThrough = new PassThrough(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put the logic into the local.service.ts
because file.service.ts
is just a wrapper of local.service.ts
and s3.service.ts
.
With that it would also be easier to add the zip functionality to S3 later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, it seems that it's not storage related and therefore the file.service.ts is the better place. It's reading all the related files from any of the storage backends, and put it in a ZIP. Before, you had the getZip in the storage specific layer, as there was a zip file already in the storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that the functionality there is storage related. Especially the call to fs.createReadStream
would be handled differently with S3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm setting this to "Request changes". See my comment above.
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.