Skip to content
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

Streaming download #74

Open
MForster opened this issue Nov 27, 2022 · 2 comments
Open

Streaming download #74

MForster opened this issue Nov 27, 2022 · 2 comments
Labels
enhancement New feature or request factorio-mod-api

Comments

@MForster
Copy link
Owner

ModPortalClient::download_mod currently returns a Result<Bytes>. We probably want a version that doesn't store the whole ZIP file in memory. Or maybe a version that goes straight to a file?

@MForster MForster added factorio-mod-api enhancement New feature or request labels Nov 27, 2022
@Builditluc
Copy link
Contributor

Builditluc commented Nov 27, 2022

We could use the bytes_stream (EDIT: docs) function in the reqwest library to convert the response into a stream of bytes and then download each chunk directly into a newly generated file (the path of the file would be given to download_mod). I can create a PR if that sounds good

@MForster
Copy link
Owner Author

That would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request factorio-mod-api
Projects
None yet
Development

No branches or pull requests

2 participants