feat: adding photo & video storage space to server stats (#14125)

* expose detailed user storage stats + display them in the storage per user table

* chore: openapi & sql

* fix: fix test stubs

* fix: formatting errors, e2e test and server test

* fix: upper lower case typo in spec file

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
weathondev 2024-11-15 23:38:57 +01:00 committed by GitHub
parent 24ae4ecff1
commit f5c4af73aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 138 additions and 7 deletions

View file

@ -16,6 +16,8 @@ class ServerStatsResponseDto {
this.photos = 0,
this.usage = 0,
this.usageByUser = const [],
this.usagePhotos = 0,
this.usageVideos = 0,
this.videos = 0,
});
@ -25,6 +27,10 @@ class ServerStatsResponseDto {
List<UsageByUserDto> usageByUser;
int usagePhotos;
int usageVideos;
int videos;
@override
@ -32,6 +38,8 @@ class ServerStatsResponseDto {
other.photos == photos &&
other.usage == usage &&
_deepEquality.equals(other.usageByUser, usageByUser) &&
other.usagePhotos == usagePhotos &&
other.usageVideos == usageVideos &&
other.videos == videos;
@override
@ -40,16 +48,20 @@ class ServerStatsResponseDto {
(photos.hashCode) +
(usage.hashCode) +
(usageByUser.hashCode) +
(usagePhotos.hashCode) +
(usageVideos.hashCode) +
(videos.hashCode);
@override
String toString() => 'ServerStatsResponseDto[photos=$photos, usage=$usage, usageByUser=$usageByUser, videos=$videos]';
String toString() => 'ServerStatsResponseDto[photos=$photos, usage=$usage, usageByUser=$usageByUser, usagePhotos=$usagePhotos, usageVideos=$usageVideos, videos=$videos]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'photos'] = this.photos;
json[r'usage'] = this.usage;
json[r'usageByUser'] = this.usageByUser;
json[r'usagePhotos'] = this.usagePhotos;
json[r'usageVideos'] = this.usageVideos;
json[r'videos'] = this.videos;
return json;
}
@ -66,6 +78,8 @@ class ServerStatsResponseDto {
photos: mapValueOfType<int>(json, r'photos')!,
usage: mapValueOfType<int>(json, r'usage')!,
usageByUser: UsageByUserDto.listFromJson(json[r'usageByUser']),
usagePhotos: mapValueOfType<int>(json, r'usagePhotos')!,
usageVideos: mapValueOfType<int>(json, r'usageVideos')!,
videos: mapValueOfType<int>(json, r'videos')!,
);
}
@ -117,6 +131,8 @@ class ServerStatsResponseDto {
'photos',
'usage',
'usageByUser',
'usagePhotos',
'usageVideos',
'videos',
};
}