mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
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:
parent
24ae4ecff1
commit
f5c4af73aa
12 changed files with 138 additions and 7 deletions
|
|
@ -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',
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue