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

libraryAPI.getFile tries to put the entire file into a string, which fails due to size limits #164

Open
justarandomgeek opened this issue Apr 22, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@justarandomgeek
Copy link

justarandomgeek commented Apr 22, 2022

when getFile downloads a video file, it tries to return the file contents in a string. This is a problem for several reasons:

  1. Video files are very large, and really shouldn't be fetched in-memory anyway, but streamed directly to some destination.
  2. Video files tend to be larger than the max string size, so this fails anyway, even if there is sufficient memory for it.
  3. Video files are not text, and thus should not be in strings. This applies to several other methods as well, such as all of the image section of the api. These things should be returned in Buffers or in Streams, ideally giving the consumer the choice. If they can only be one, they should be Streams.
@thornbill
Copy link
Member

I doubt there is much I can do about the generated function. I could add a utility function to get the url like I did for photos.

@justarandomgeek
Copy link
Author

Well that's pretty broken then. I guess I'll migrate away from this library to just doing my own requests!

@thornbill thornbill reopened this Apr 24, 2022
@thornbill thornbill added the enhancement New feature or request label Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants