diff --git a/app/lib/frontend/handlers/custom_api.dart b/app/lib/frontend/handlers/custom_api.dart index 747f971836..a70b7fa5c9 100644 --- a/app/lib/frontend/handlers/custom_api.dart +++ b/app/lib/frontend/handlers/custom_api.dart @@ -246,6 +246,7 @@ Future packageVersionScoreHandler( grantedPoints: card.grantedPubPoints, maxPoints: card.maxPubPoints, likeCount: pkg.likes, + downloadCount30Days: card.thirtyDaysDownloadCounts, popularityScore: card.popularityScore, tags: tags.toList(), lastUpdated: updated, diff --git a/pkg/_pub_shared/lib/data/package_api.dart b/pkg/_pub_shared/lib/data/package_api.dart index 45255d16d8..504fdc5464 100644 --- a/pkg/_pub_shared/lib/data/package_api.dart +++ b/pkg/_pub_shared/lib/data/package_api.dart @@ -279,6 +279,7 @@ class VersionScore { final int? grantedPoints; final int? maxPoints; final int? likeCount; + final int? downloadCount30Days; final double? popularityScore; final List? tags; final DateTime? lastUpdated; @@ -287,6 +288,7 @@ class VersionScore { required this.grantedPoints, required this.maxPoints, required this.likeCount, + required this.downloadCount30Days, required this.popularityScore, required this.tags, required this.lastUpdated, diff --git a/pkg/_pub_shared/lib/data/package_api.g.dart b/pkg/_pub_shared/lib/data/package_api.g.dart index 403ea038f4..0fc35ee147 100644 --- a/pkg/_pub_shared/lib/data/package_api.g.dart +++ b/pkg/_pub_shared/lib/data/package_api.g.dart @@ -180,6 +180,7 @@ VersionScore _$VersionScoreFromJson(Map json) => VersionScore( grantedPoints: (json['grantedPoints'] as num?)?.toInt(), maxPoints: (json['maxPoints'] as num?)?.toInt(), likeCount: (json['likeCount'] as num?)?.toInt(), + downloadCount30Days: (json['downloadCount30Days'] as num?)?.toInt(), popularityScore: (json['popularityScore'] as num?)?.toDouble(), tags: (json['tags'] as List?)?.map((e) => e as String).toList(), lastUpdated: json['lastUpdated'] == null @@ -192,6 +193,8 @@ Map _$VersionScoreToJson(VersionScore instance) => if (instance.grantedPoints case final value?) 'grantedPoints': value, if (instance.maxPoints case final value?) 'maxPoints': value, if (instance.likeCount case final value?) 'likeCount': value, + if (instance.downloadCount30Days case final value?) + 'downloadCount30Days': value, if (instance.popularityScore case final value?) 'popularityScore': value, if (instance.tags case final value?) 'tags': value, if (instance.lastUpdated?.toIso8601String() case final value?)