-
Notifications
You must be signed in to change notification settings - Fork 0
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: allow to download multiple files and folders #16
Conversation
d76c7ca
to
558c791
Compare
Remember adding (minimal) unittests for this new implementation |
@Ian2012: I tried it but it's not working for me. It stays polling the task status, do I need some setup done in my local environment? |
Also, can we add a message indicating that the download is in progress? So the user waits for it |
1d8fe9d
to
441fb5c
Compare
0767301
to
fd14876
Compare
0b80fb3
to
fa9bdfe
Compare
test: adjust docstrings docs: fix indentation issues
fa9bdfe
to
2b64b83
Compare
for content in folder_structure: | ||
if asset_key:=content.get("asset_key"): | ||
file_content = contentstore().find(AssetKey.from_string(asset_key)) | ||
ziph.writestr(zinfo_or_arcname=content["path"], data=file_content.data) |
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.
ziph.writestr(zinfo_or_arcname=content["path"], data=file_content.data) | |
ziph.writestr(zinfo_or_arcname=content["path"], data=file_content.data) | |
8512c51
to
cb53889
Compare
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.
LGTM. Thanks!
4a869a4
to
01f54cc
Compare
01f54cc
to
6f3ba4f
Compare
Description
This PR allows to download of multiple files in a zip file. It does so by creating a celery task with the contents to download, and it creates the zip file and uploads it to the default django storage. The task ID is returned so that the client can perform long pulling to verify the state of the task. Once the task status is
SUCCESS,
the download URL is returned as part of the task result and the file is automatically downloaded for the client in a file calleddownload.zip
This implementation support folders and files.