Skip to content

Commit

Permalink
NuGetV2-OData: retrieve versions in descending order
Browse files Browse the repository at this point in the history
Some feeds have broken paging behavior. Getting only newer versions seems less of an issue than getting only older versions.
  • Loading branch information
cdrnet committed Nov 8, 2016
1 parent d97f9c7 commit 0611633
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Paket.Core/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ let rec private followODataLink auth url =
let tryGetAllVersionsFromNugetODataWithFilter (auth, nugetURL, package:PackageName) =
async {
try
let url = sprintf "%s/Packages?$filter=tolower(Id) eq '%s'" nugetURL (package.GetCompareString())
let url = sprintf "%s/Packages?$orderby=Published desc&$filter=tolower(Id) eq '%s'" nugetURL (package.GetCompareString())
verbosefn "getAllVersionsFromNugetODataWithFilter from url '%s'" url
let! result = followODataLink auth url
return Some result
Expand All @@ -66,7 +66,7 @@ let tryGetAllVersionsFromNugetODataWithFilter (auth, nugetURL, package:PackageNa
let tryGetPackageVersionsViaOData (auth, nugetURL, package:PackageName) =
async {
try
let url = sprintf "%s/FindPackagesById()?id='%O'" nugetURL package
let url = sprintf "%s/FindPackagesById()?$orderby=Published desc&id='%O'" nugetURL package
verbosefn "getAllVersionsFromNugetOData from url '%s'" url
let! result = followODataLink auth url
return Some result
Expand Down

0 comments on commit 0611633

Please sign in to comment.