We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
One query returns a maximum of 1000 items. how do i get the rest of them? Does java sdk provides a way to skip like this php program? https://blogs.msdn.microsoft.com/randomnumber/2015/11/05/listing-more-than-1000-assets-with-the-php-sdk-for-azure-media-services/ My code: MediaContract mediaService = MediaService.create(MediaConfiguration.configureWithOAuthAuthentication( mediaServiceUri, oAuthUri, AMSAccountName, AMSAccountKey, scope)); List<AssetInfo> info = mediaService.list(Asset.list()); Thanks,
MediaContract mediaService = MediaService.create(MediaConfiguration.configureWithOAuthAuthentication( mediaServiceUri, oAuthUri, AMSAccountName, AMSAccountKey, scope));
List<AssetInfo> info = mediaService.list(Asset.list());
The text was updated successfully, but these errors were encountered:
Here is my own solution after getting some help from stackoverflow
List<AssetInfo> allAssets = new ArrayList<>(); int skip = 0; while (true) { List<AssetInfo> curAssets = mediaService.list(getAllAssetPage(skip)); if (curAssets.size() > 0) { allAssets.addAll(curAssets); if (curAssets.size() == 1000) { System.out.println(String.format("Got %d assets.", allAssets.size())); skip += 1000; } else { break; } } else { break; } } private static DefaultListOperation<AssetInfo> getAllAssetPage(int skip) { return new DefaultListOperation<AssetInfo>("Assets", new GenericType<ListResult<AssetInfo>>() { }).setSkip(skip); }
Sorry, something went wrong.
Hi @kennethinsnow
Thanks for sharing your solution!
No branches or pull requests
One query returns a maximum of 1000 items. how do i get the rest of them? Does java sdk provides a way to skip like this php program?
https://blogs.msdn.microsoft.com/randomnumber/2015/11/05/listing-more-than-1000-assets-with-the-php-sdk-for-azure-media-services/
My code:
MediaContract mediaService = MediaService.create(MediaConfiguration.configureWithOAuthAuthentication( mediaServiceUri, oAuthUri, AMSAccountName, AMSAccountKey, scope));
List<AssetInfo> info = mediaService.list(Asset.list());
Thanks,
The text was updated successfully, but these errors were encountered: