Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions app/lib/scorecard/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,7 @@ class ScoreCardBackend {
throw NotFoundException.resource('package "$package" version "$version"');
}

var updated = pkg.updated;
final card = await scoreCardBackend.getScoreCardData(package, v);
if (updated == null || card.updated?.isAfter(updated) == true) {
updated = card.updated;
}

final tags = <String>{
...pkg.getTags(),
...pv.getTags(),
Expand All @@ -229,7 +224,6 @@ class ScoreCardBackend {
downloadCount30Days:
downloadCountsBackend.lookup30DaysTotalCounts(package),
tags: tags.toList(),
lastUpdated: updated,
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/test/frontend/handlers/custom_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ void main() {
'grantedPoints': greaterThan(10),
'maxPoints': greaterThan(50),
'likeCount': 0,
'downloadCount30Days': null,
'tags': contains('sdk:dart'),
'lastUpdated': isNotEmpty,
});
},
);
Expand Down
2 changes: 1 addition & 1 deletion app/test/package/api_export/api_exporter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ Future<void> _testExportedApiSynchronization(
'grantedPoints': isNotNull,
'maxPoints': isNotNull,
'likeCount': isNotNull,
'downloadCount30Days': null,
'tags': isNotEmpty,
'lastUpdated': isNotNull,
},
);
expect(
Expand Down
4 changes: 1 addition & 3 deletions pkg/_pub_shared/lib/data/package_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -274,22 +274,20 @@ class VersionInfo {
Map<String, dynamic> toJson() => _$VersionInfoToJson(this);
}

@JsonSerializable(includeIfNull: false)
@JsonSerializable(includeIfNull: true)
class VersionScore {
final int? grantedPoints;
final int? maxPoints;
final int? likeCount;
final int? downloadCount30Days;
final List<String>? tags;
final DateTime? lastUpdated;

VersionScore({
required this.grantedPoints,
required this.maxPoints,
required this.likeCount,
required this.downloadCount30Days,
required this.tags,
required this.lastUpdated,
});

factory VersionScore.fromJson(Map<String, dynamic> json) =>
Expand Down
16 changes: 5 additions & 11 deletions pkg/_pub_shared/lib/data/package_api.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.