Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(NuGet#9) Alter query emitted when doing a count query
In a previous commit, changes were made to allow the execution of a count query, to get information back about the number of packages that meet a specific query. During testing, it was found that this query, which included usage of the skip and top options, wasn't working as expected when hitting a Nexus Repository v2 feed. Instead of returning the number of packages, it would instead return the number that was included in the top parameter, which was hard-coded to 1. This then caused a problem when using Chocolatey GUI, since Chocolatey GUI needs to know the total number of packages for a query, so that it can set up the necessary paging within the application to see all the results. This commit alters the V2FeedQueryBuilder class to have a completely separate format string for the count query, rather than trying to use the existing search format string. This means that there is clear segregation between the format strings is use, and we can then easily remove the problematic skip/top options. It should be noted that other repository servers did not have a problem with these extra options, it was only found that Nexus did. However, this change also makes the count query the same as the one that was emitted by Chocolatey CLI 1.x, so it makes sense to move forward with this change.
- Loading branch information