From 1d2d27fafbe74cf61595fcdb16f9e2daf4d99796 Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Fri, 21 Apr 2023 16:42:02 +0100 Subject: [PATCH] (maint) Switch from int to long When testing usage of nuget.org, there is a single package that has over 3 billion downloads. When attempting to view this package in Chocolatey GUI, there is a convert error, when it tries to convert this nubmer into an int. This is a similar change to what was done in CCR, when we crossed over the 1B mark for downloads. --- .../ViewModels/Items/PackageViewModel.cs | 8 ++++---- Source/ChocolateyGui.Common/Models/Package.cs | 4 ++-- .../ViewModels/Items/IPackageViewModel.cs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs b/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs index 5334e505d..61218a17e 100644 --- a/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs +++ b/Source/ChocolateyGui.Common.Windows/ViewModels/Items/PackageViewModel.cs @@ -60,7 +60,7 @@ public class PackageViewModel : private string _description; - private int _downloadCount; + private long _downloadCount; private string _galleryDetailsUrl; @@ -112,7 +112,7 @@ public class PackageViewModel : private NuGetVersion _version; - private int _versionDownloadCount; + private long _versionDownloadCount; public PackageViewModel( IChocolateyService chocolateyService, @@ -199,7 +199,7 @@ public string Description set { SetPropertyValue(ref _description, value); } } - public int DownloadCount + public long DownloadCount { get { return _downloadCount; } set { SetPropertyValue(ref _downloadCount, value); } @@ -384,7 +384,7 @@ public NuGetVersion Version set { SetPropertyValue(ref _version, value); } } - public int VersionDownloadCount + public long VersionDownloadCount { get { return _versionDownloadCount; } set { SetPropertyValue(ref _versionDownloadCount, value); } diff --git a/Source/ChocolateyGui.Common/Models/Package.cs b/Source/ChocolateyGui.Common/Models/Package.cs index 7720d2a08..b516c13df 100644 --- a/Source/ChocolateyGui.Common/Models/Package.cs +++ b/Source/ChocolateyGui.Common/Models/Package.cs @@ -20,7 +20,7 @@ public class Package public string Description { get; set; } - public int DownloadCount { get; set; } + public long DownloadCount { get; set; } public string GalleryDetailsUrl { get; set; } @@ -68,6 +68,6 @@ public class Package public NuGetVersion Version { get; set; } - public int VersionDownloadCount { get; set; } + public long VersionDownloadCount { get; set; } } } \ No newline at end of file diff --git a/Source/ChocolateyGui.Common/ViewModels/Items/IPackageViewModel.cs b/Source/ChocolateyGui.Common/ViewModels/Items/IPackageViewModel.cs index d97c41de7..49dcffb8c 100644 --- a/Source/ChocolateyGui.Common/ViewModels/Items/IPackageViewModel.cs +++ b/Source/ChocolateyGui.Common/ViewModels/Items/IPackageViewModel.cs @@ -23,7 +23,7 @@ public interface IPackageViewModel string Description { get; set; } - int DownloadCount { get; set; } + long DownloadCount { get; set; } string GalleryDetailsUrl { get; set; } @@ -73,7 +73,7 @@ public interface IPackageViewModel NuGetVersion Version { get; set; } - int VersionDownloadCount { get; set; } + long VersionDownloadCount { get; set; } Task Install();