1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

feat(server, web): quotas (#4471)

* feat: quotas

* chore: open api

* chore: update status box and upload error message

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
cfitzw
2024-01-12 18:43:36 -06:00
committed by GitHub
parent f4edb6c4bd
commit deb1f970a8
63 changed files with 646 additions and 118 deletions

View File

@ -14,6 +14,7 @@ class UsageByUserDto {
/// Returns a new [UsageByUserDto] instance.
UsageByUserDto({
required this.photos,
required this.quotaSizeInBytes,
required this.usage,
required this.userId,
required this.userName,
@ -22,6 +23,8 @@ class UsageByUserDto {
int photos;
int? quotaSizeInBytes;
int usage;
String userId;
@ -33,6 +36,7 @@ class UsageByUserDto {
@override
bool operator ==(Object other) => identical(this, other) || other is UsageByUserDto &&
other.photos == photos &&
other.quotaSizeInBytes == quotaSizeInBytes &&
other.usage == usage &&
other.userId == userId &&
other.userName == userName &&
@ -42,17 +46,23 @@ class UsageByUserDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(photos.hashCode) +
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
(usage.hashCode) +
(userId.hashCode) +
(userName.hashCode) +
(videos.hashCode);
@override
String toString() => 'UsageByUserDto[photos=$photos, usage=$usage, userId=$userId, userName=$userName, videos=$videos]';
String toString() => 'UsageByUserDto[photos=$photos, quotaSizeInBytes=$quotaSizeInBytes, usage=$usage, userId=$userId, userName=$userName, videos=$videos]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'photos'] = this.photos;
if (this.quotaSizeInBytes != null) {
json[r'quotaSizeInBytes'] = this.quotaSizeInBytes;
} else {
// json[r'quotaSizeInBytes'] = null;
}
json[r'usage'] = this.usage;
json[r'userId'] = this.userId;
json[r'userName'] = this.userName;
@ -69,6 +79,7 @@ class UsageByUserDto {
return UsageByUserDto(
photos: mapValueOfType<int>(json, r'photos')!,
quotaSizeInBytes: mapValueOfType<int>(json, r'quotaSizeInBytes'),
usage: mapValueOfType<int>(json, r'usage')!,
userId: mapValueOfType<String>(json, r'userId')!,
userName: mapValueOfType<String>(json, r'userName')!,
@ -121,6 +132,7 @@ class UsageByUserDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'photos',
'quotaSizeInBytes',
'usage',
'userId',
'userName',