Fixes the version search numerical conversion - hopefully this makes the search actually work correctly

This commit is contained in:
Shannon
2017-04-26 23:00:29 +10:00
parent 905a938444
commit 385c767a48
3 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -92,8 +92,8 @@ namespace OurUmbraco.Project
{
var asLong =
version.Major.ToString().PadLeft(3, '0')
+ (version.Minor == -1 ? "0" : version.Minor.ToString()).PadRight(3, '0')
+ (version.Build == -1 ? "0" : version.Build.ToString()).PadRight(3, '0');
+ (version.Minor == -1 ? "0" : version.Minor.ToString()).PadLeft(3, '0')
+ (version.Build == -1 ? "0" : version.Build.ToString()).PadLeft(3, '0');
return long.Parse(asLong);
}
@@ -9,7 +9,7 @@ namespace OurUmbraco.Repository.Models
Images = new List<PackageImage>();
Compatibility = new List<PackageCompatibility>();
ExternalSources = new List<ExternalSource>();
StrictFileVersion = new List<PackageVersionSupport>();
StrictFileVersions = new List<PackageVersionSupport>();
}
public PackageDetails(Package package)
@@ -38,7 +38,7 @@ namespace OurUmbraco.Repository.Models
/// <summary>
/// Lists all files that have strict versions
/// </summary>
public List<PackageVersionSupport> StrictFileVersion { get; set; }
public List<PackageVersionSupport> StrictFileVersions { get; set; }
/// <summary>
/// A list of all supported/targeted Umbraco versions for all files for this package
@@ -232,6 +232,7 @@ namespace OurUmbraco.Repository.Services
{
TargetedUmbracoVersions = GetAllFilePackageVersions(allPackageFiles).Select(x => x.ToString(3)).ToArray(),
Compatibility = GetPackageCompatibility(content),
StrictFileVersions = strictPackageFileVersions.ToList(),
NetVersion = content.GetPropertyValue<string>("dotNetVersion"),
LicenseName = content.GetPropertyValue<string>("licenseName"),
LicenseUrl = content.GetPropertyValue<string>("licenseUrl"),