Currently the 2 API calls are asynchronous: First all images from a user are downloaded in batches of 500 pics/request. This means the web app needs to make 44 API calls for a username with 22000 pictures (22000/500). Once all images are downloaded the whole array with image ID's is split into batches of 50 id's, which are used in the second API call to get the global usage of each picture (22000/50=440 calls).
Instead of doing one API call after the other they should be fired synchronously.
Possible challenge: Race conditions.
Currently the 2 API calls are asynchronous: First all images from a user are downloaded in batches of 500 pics/request. This means the web app needs to make 44 API calls for a username with 22000 pictures (22000/500). Once all images are downloaded the whole array with image ID's is split into batches of 50 id's, which are used in the second API call to get the global usage of each picture (22000/50=440 calls).
Instead of doing one API call after the other they should be fired synchronously.
Possible challenge: Race conditions.