[Feature] Bulk endpoint to get file sizes for a list of asset IDs #31694
Closed
jake-bybee
started this conversation in
Feature Request
Replies: 1 comment
|
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have searched the existing feature requests, both open and closed, to make sure this is not a duplicate request.
The feature
I'd like an endpoint that accepts a list of asset IDs and returns the file size of each individual asset.
Use case
I'm writing a client that bulk downloads assets with several concurrent requests. To plan batches and show accurate progress, I need to know how big each file is before downloading it.
Current situation
POST /download/inforeturns sizes per archive, not per asset, so I can't see how large each individual file is.GET /assets/{id}includesexifInfo.fileSizeInByte, but that means one request per asset. For a large library that is thousands of round trips just to read a number.Proposal
A single request that takes many IDs and returns ID and size pairs, for example:
Request: { "assetIds": ["id1", "id2", ...] }
Response: [ { "id": "id1", "fileSizeInByte": 1234567 }, ... ]
This could be a small new endpoint or an optional extension to
POST /download/info. I'm happy with either shape.The size is already stored in
exif.fileSizeInByte, so this should be a single indexed lookup on the server side.Willing to contribute
I'm happy to develop this myself and open a PR. I'd like to agree on the endpoint design first, so let me know which shape you'd prefer (new endpoint vs. extending
/download/info) and I'll get started.Platform
All reactions