mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 20:25:32 -04:00
feat(mobile): quota (#6409)
* feat(mobile): quota * openapi * user entity update * Render quota * refresh usage upon opening the app bar * stop backup when quota exceed
This commit is contained in:
parent
abce82e235
commit
78de4f1312
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"flutterSdkVersion": "3.13.0",
|
|
||||||
"flavors": {}
|
|
||||||
}
|
|
3
mobile/.fvmrc
Normal file
3
mobile/.fvmrc
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"flutter": "3.13.6"
|
||||||
|
}
|
6
mobile/.gitignore
vendored
6
mobile/.gitignore
vendored
@ -31,7 +31,6 @@
|
|||||||
.pub-cache/
|
.pub-cache/
|
||||||
.pub/
|
.pub/
|
||||||
/build/
|
/build/
|
||||||
.fvm/flutter_sdk
|
|
||||||
|
|
||||||
# Web related
|
# Web related
|
||||||
lib/generated_plugin_registrant.dart
|
lib/generated_plugin_registrant.dart
|
||||||
@ -53,4 +52,7 @@ ios/fastlane/report.xml
|
|||||||
# Isar
|
# Isar
|
||||||
default.isar
|
default.isar
|
||||||
default.isar.lock
|
default.isar.lock
|
||||||
libisar.so
|
libisar.so
|
||||||
|
|
||||||
|
# FVM Version Cache
|
||||||
|
.fvm/
|
4
mobile/.vscode/settings.json
vendored
4
mobile/.vscode/settings.json
vendored
@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
"dart.flutterSdkPath": ".fvm/flutter_sdk",
|
"dart.flutterSdkPath": ".fvm\\versions\\3.13.6",
|
||||||
// Remove .fvm files from search
|
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"**/.fvm": true
|
"**/.fvm": true
|
||||||
},
|
},
|
||||||
// Remove from file watching
|
|
||||||
"files.watcherExclude": {
|
"files.watcherExclude": {
|
||||||
"**/.fvm": true
|
"**/.fvm": true
|
||||||
}
|
}
|
||||||
|
@ -179,4 +179,4 @@ SPEC CHECKSUMS:
|
|||||||
|
|
||||||
PODFILE CHECKSUM: 599d8aeb73728400c15364e734525722250a5382
|
PODFILE CHECKSUM: 599d8aeb73728400c15364e734525722250a5382
|
||||||
|
|
||||||
COCOAPODS: 1.12.1
|
COCOAPODS: 1.11.3
|
||||||
|
@ -81,6 +81,7 @@ Future<void> initApp() async {
|
|||||||
|
|
||||||
PlatformDispatcher.instance.onError = (error, stack) {
|
PlatformDispatcher.instance.onError = (error, stack) {
|
||||||
log.severe('PlatformDispatcher - Catch all error: $error', error, stack);
|
log.severe('PlatformDispatcher - Catch all error: $error', error, stack);
|
||||||
|
debugPrint("PlatformDispatcher - Catch all error: $error $stack");
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -363,6 +363,7 @@ class BackupService {
|
|||||||
} else {
|
} else {
|
||||||
var data = await response.stream.bytesToString();
|
var data = await response.stream.bytesToString();
|
||||||
var error = jsonDecode(data);
|
var error = jsonDecode(data);
|
||||||
|
var errorMessage = error['message'] ?? error['error'];
|
||||||
|
|
||||||
debugPrint(
|
debugPrint(
|
||||||
"Error(${error['statusCode']}) uploading ${entity.id} | $originalFileName | Created on ${entity.createDateTime} | ${error['error']}",
|
"Error(${error['statusCode']}) uploading ${entity.id} | $originalFileName | Created on ${entity.createDateTime} | ${error['error']}",
|
||||||
@ -375,9 +376,14 @@ class BackupService {
|
|||||||
fileCreatedAt: entity.createDateTime,
|
fileCreatedAt: entity.createDateTime,
|
||||||
fileName: originalFileName,
|
fileName: originalFileName,
|
||||||
fileType: _getAssetType(entity.type),
|
fileType: _getAssetType(entity.type),
|
||||||
errorMessage: error['error'],
|
errorMessage: errorMessage,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (errorMessage == "Quota has been exceeded!") {
|
||||||
|
anyErrors = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,9 +57,9 @@ class FailedBackupStatusPage extends HookConsumerWidget {
|
|||||||
ConstrainedBox(
|
ConstrainedBox(
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
minWidth: 100,
|
minWidth: 100,
|
||||||
minHeight: 150,
|
minHeight: 100,
|
||||||
maxWidth: 100,
|
maxWidth: 100,
|
||||||
maxHeight: 200,
|
maxHeight: 150,
|
||||||
),
|
),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
@ -95,9 +95,10 @@ class FailedBackupStatusPage extends HookConsumerWidget {
|
|||||||
).toLocal(),
|
).toLocal(),
|
||||||
),
|
),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Colors.grey[700],
|
color: context.isDarkTheme
|
||||||
|
? Colors.white70
|
||||||
|
: Colors.grey[800],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Icon(
|
Icon(
|
||||||
@ -115,7 +116,6 @@ class FailedBackupStatusPage extends HookConsumerWidget {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 12,
|
|
||||||
color: context.primaryColor,
|
color: context.primaryColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -123,9 +123,10 @@ class FailedBackupStatusPage extends HookConsumerWidget {
|
|||||||
Text(
|
Text(
|
||||||
errorAsset.errorMessage,
|
errorAsset.errorMessage,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: Colors.grey[800],
|
color: context.isDarkTheme
|
||||||
|
? Colors.white70
|
||||||
|
: Colors.grey[800],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -21,6 +21,8 @@ class User {
|
|||||||
this.avatarColor = AvatarColorEnum.primary,
|
this.avatarColor = AvatarColorEnum.primary,
|
||||||
this.memoryEnabled = true,
|
this.memoryEnabled = true,
|
||||||
this.inTimeline = false,
|
this.inTimeline = false,
|
||||||
|
this.quotaUsageInBytes = 0,
|
||||||
|
this.quotaSizeInBytes = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
Id get isarId => fastHash(id);
|
Id get isarId => fastHash(id);
|
||||||
@ -36,7 +38,9 @@ class User {
|
|||||||
isAdmin = dto.isAdmin,
|
isAdmin = dto.isAdmin,
|
||||||
memoryEnabled = dto.memoriesEnabled ?? false,
|
memoryEnabled = dto.memoriesEnabled ?? false,
|
||||||
avatarColor = dto.avatarColor.toAvatarColor(),
|
avatarColor = dto.avatarColor.toAvatarColor(),
|
||||||
inTimeline = false;
|
inTimeline = false,
|
||||||
|
quotaUsageInBytes = dto.quotaUsageInBytes ?? 0,
|
||||||
|
quotaSizeInBytes = dto.quotaSizeInBytes ?? 0;
|
||||||
|
|
||||||
User.fromPartnerDto(PartnerResponseDto dto)
|
User.fromPartnerDto(PartnerResponseDto dto)
|
||||||
: id = dto.id,
|
: id = dto.id,
|
||||||
@ -49,7 +53,9 @@ class User {
|
|||||||
isAdmin = dto.isAdmin,
|
isAdmin = dto.isAdmin,
|
||||||
memoryEnabled = dto.memoriesEnabled ?? false,
|
memoryEnabled = dto.memoriesEnabled ?? false,
|
||||||
avatarColor = dto.avatarColor.toAvatarColor(),
|
avatarColor = dto.avatarColor.toAvatarColor(),
|
||||||
inTimeline = dto.inTimeline ?? false;
|
inTimeline = dto.inTimeline ?? false,
|
||||||
|
quotaUsageInBytes = dto.quotaUsageInBytes ?? 0,
|
||||||
|
quotaSizeInBytes = dto.quotaSizeInBytes ?? 0;
|
||||||
|
|
||||||
/// Base user dto used where the complete user object is not required
|
/// Base user dto used where the complete user object is not required
|
||||||
User.fromSimpleUserDto(UserDto dto)
|
User.fromSimpleUserDto(UserDto dto)
|
||||||
@ -64,7 +70,9 @@ class User {
|
|||||||
memoryEnabled = false,
|
memoryEnabled = false,
|
||||||
isPartnerSharedBy = false,
|
isPartnerSharedBy = false,
|
||||||
isPartnerSharedWith = false,
|
isPartnerSharedWith = false,
|
||||||
updatedAt = DateTime.now();
|
updatedAt = DateTime.now(),
|
||||||
|
quotaUsageInBytes = 0,
|
||||||
|
quotaSizeInBytes = 0;
|
||||||
|
|
||||||
@Index(unique: true, replace: false, type: IndexType.hash)
|
@Index(unique: true, replace: false, type: IndexType.hash)
|
||||||
String id;
|
String id;
|
||||||
@ -79,7 +87,10 @@ class User {
|
|||||||
AvatarColorEnum avatarColor;
|
AvatarColorEnum avatarColor;
|
||||||
bool memoryEnabled;
|
bool memoryEnabled;
|
||||||
bool inTimeline;
|
bool inTimeline;
|
||||||
|
int quotaUsageInBytes;
|
||||||
|
int quotaSizeInBytes;
|
||||||
|
|
||||||
|
bool get hasQuota => quotaSizeInBytes > 0;
|
||||||
@Backlink(to: 'owner')
|
@Backlink(to: 'owner')
|
||||||
final IsarLinks<Album> albums = IsarLinks<Album>();
|
final IsarLinks<Album> albums = IsarLinks<Album>();
|
||||||
@Backlink(to: 'sharedUsers')
|
@Backlink(to: 'sharedUsers')
|
||||||
@ -98,7 +109,9 @@ class User {
|
|||||||
profileImagePath == other.profileImagePath &&
|
profileImagePath == other.profileImagePath &&
|
||||||
isAdmin == other.isAdmin &&
|
isAdmin == other.isAdmin &&
|
||||||
memoryEnabled == other.memoryEnabled &&
|
memoryEnabled == other.memoryEnabled &&
|
||||||
inTimeline == other.inTimeline;
|
inTimeline == other.inTimeline &&
|
||||||
|
quotaUsageInBytes == other.quotaUsageInBytes &&
|
||||||
|
quotaSizeInBytes == other.quotaSizeInBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -114,7 +127,9 @@ class User {
|
|||||||
avatarColor.hashCode ^
|
avatarColor.hashCode ^
|
||||||
isAdmin.hashCode ^
|
isAdmin.hashCode ^
|
||||||
memoryEnabled.hashCode ^
|
memoryEnabled.hashCode ^
|
||||||
inTimeline.hashCode;
|
inTimeline.hashCode ^
|
||||||
|
quotaUsageInBytes.hashCode ^
|
||||||
|
quotaSizeInBytes.hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum AvatarColorEnum {
|
enum AvatarColorEnum {
|
||||||
|
319
mobile/lib/shared/models/user.g.dart
generated
319
mobile/lib/shared/models/user.g.dart
generated
@ -28,48 +28,63 @@ const UserSchema = CollectionSchema(
|
|||||||
name: r'email',
|
name: r'email',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'id': PropertySchema(
|
r'hasQuota': PropertySchema(
|
||||||
id: 2,
|
id: 2,
|
||||||
|
name: r'hasQuota',
|
||||||
|
type: IsarType.bool,
|
||||||
|
),
|
||||||
|
r'id': PropertySchema(
|
||||||
|
id: 3,
|
||||||
name: r'id',
|
name: r'id',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'inTimeline': PropertySchema(
|
r'inTimeline': PropertySchema(
|
||||||
id: 3,
|
id: 4,
|
||||||
name: r'inTimeline',
|
name: r'inTimeline',
|
||||||
type: IsarType.bool,
|
type: IsarType.bool,
|
||||||
),
|
),
|
||||||
r'isAdmin': PropertySchema(
|
r'isAdmin': PropertySchema(
|
||||||
id: 4,
|
id: 5,
|
||||||
name: r'isAdmin',
|
name: r'isAdmin',
|
||||||
type: IsarType.bool,
|
type: IsarType.bool,
|
||||||
),
|
),
|
||||||
r'isPartnerSharedBy': PropertySchema(
|
r'isPartnerSharedBy': PropertySchema(
|
||||||
id: 5,
|
id: 6,
|
||||||
name: r'isPartnerSharedBy',
|
name: r'isPartnerSharedBy',
|
||||||
type: IsarType.bool,
|
type: IsarType.bool,
|
||||||
),
|
),
|
||||||
r'isPartnerSharedWith': PropertySchema(
|
r'isPartnerSharedWith': PropertySchema(
|
||||||
id: 6,
|
id: 7,
|
||||||
name: r'isPartnerSharedWith',
|
name: r'isPartnerSharedWith',
|
||||||
type: IsarType.bool,
|
type: IsarType.bool,
|
||||||
),
|
),
|
||||||
r'memoryEnabled': PropertySchema(
|
r'memoryEnabled': PropertySchema(
|
||||||
id: 7,
|
id: 8,
|
||||||
name: r'memoryEnabled',
|
name: r'memoryEnabled',
|
||||||
type: IsarType.bool,
|
type: IsarType.bool,
|
||||||
),
|
),
|
||||||
r'name': PropertySchema(
|
r'name': PropertySchema(
|
||||||
id: 8,
|
id: 9,
|
||||||
name: r'name',
|
name: r'name',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
r'profileImagePath': PropertySchema(
|
r'profileImagePath': PropertySchema(
|
||||||
id: 9,
|
id: 10,
|
||||||
name: r'profileImagePath',
|
name: r'profileImagePath',
|
||||||
type: IsarType.string,
|
type: IsarType.string,
|
||||||
),
|
),
|
||||||
|
r'quotaSizeInBytes': PropertySchema(
|
||||||
|
id: 11,
|
||||||
|
name: r'quotaSizeInBytes',
|
||||||
|
type: IsarType.long,
|
||||||
|
),
|
||||||
|
r'quotaUsageInBytes': PropertySchema(
|
||||||
|
id: 12,
|
||||||
|
name: r'quotaUsageInBytes',
|
||||||
|
type: IsarType.long,
|
||||||
|
),
|
||||||
r'updatedAt': PropertySchema(
|
r'updatedAt': PropertySchema(
|
||||||
id: 10,
|
id: 13,
|
||||||
name: r'updatedAt',
|
name: r'updatedAt',
|
||||||
type: IsarType.dateTime,
|
type: IsarType.dateTime,
|
||||||
)
|
)
|
||||||
@ -138,15 +153,18 @@ void _userSerialize(
|
|||||||
) {
|
) {
|
||||||
writer.writeByte(offsets[0], object.avatarColor.index);
|
writer.writeByte(offsets[0], object.avatarColor.index);
|
||||||
writer.writeString(offsets[1], object.email);
|
writer.writeString(offsets[1], object.email);
|
||||||
writer.writeString(offsets[2], object.id);
|
writer.writeBool(offsets[2], object.hasQuota);
|
||||||
writer.writeBool(offsets[3], object.inTimeline);
|
writer.writeString(offsets[3], object.id);
|
||||||
writer.writeBool(offsets[4], object.isAdmin);
|
writer.writeBool(offsets[4], object.inTimeline);
|
||||||
writer.writeBool(offsets[5], object.isPartnerSharedBy);
|
writer.writeBool(offsets[5], object.isAdmin);
|
||||||
writer.writeBool(offsets[6], object.isPartnerSharedWith);
|
writer.writeBool(offsets[6], object.isPartnerSharedBy);
|
||||||
writer.writeBool(offsets[7], object.memoryEnabled);
|
writer.writeBool(offsets[7], object.isPartnerSharedWith);
|
||||||
writer.writeString(offsets[8], object.name);
|
writer.writeBool(offsets[8], object.memoryEnabled);
|
||||||
writer.writeString(offsets[9], object.profileImagePath);
|
writer.writeString(offsets[9], object.name);
|
||||||
writer.writeDateTime(offsets[10], object.updatedAt);
|
writer.writeString(offsets[10], object.profileImagePath);
|
||||||
|
writer.writeLong(offsets[11], object.quotaSizeInBytes);
|
||||||
|
writer.writeLong(offsets[12], object.quotaUsageInBytes);
|
||||||
|
writer.writeDateTime(offsets[13], object.updatedAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
User _userDeserialize(
|
User _userDeserialize(
|
||||||
@ -160,15 +178,17 @@ User _userDeserialize(
|
|||||||
_UseravatarColorValueEnumMap[reader.readByteOrNull(offsets[0])] ??
|
_UseravatarColorValueEnumMap[reader.readByteOrNull(offsets[0])] ??
|
||||||
AvatarColorEnum.primary,
|
AvatarColorEnum.primary,
|
||||||
email: reader.readString(offsets[1]),
|
email: reader.readString(offsets[1]),
|
||||||
id: reader.readString(offsets[2]),
|
id: reader.readString(offsets[3]),
|
||||||
inTimeline: reader.readBoolOrNull(offsets[3]) ?? false,
|
inTimeline: reader.readBoolOrNull(offsets[4]) ?? false,
|
||||||
isAdmin: reader.readBool(offsets[4]),
|
isAdmin: reader.readBool(offsets[5]),
|
||||||
isPartnerSharedBy: reader.readBoolOrNull(offsets[5]) ?? false,
|
isPartnerSharedBy: reader.readBoolOrNull(offsets[6]) ?? false,
|
||||||
isPartnerSharedWith: reader.readBoolOrNull(offsets[6]) ?? false,
|
isPartnerSharedWith: reader.readBoolOrNull(offsets[7]) ?? false,
|
||||||
memoryEnabled: reader.readBoolOrNull(offsets[7]) ?? true,
|
memoryEnabled: reader.readBoolOrNull(offsets[8]) ?? true,
|
||||||
name: reader.readString(offsets[8]),
|
name: reader.readString(offsets[9]),
|
||||||
profileImagePath: reader.readStringOrNull(offsets[9]) ?? '',
|
profileImagePath: reader.readStringOrNull(offsets[10]) ?? '',
|
||||||
updatedAt: reader.readDateTime(offsets[10]),
|
quotaSizeInBytes: reader.readLongOrNull(offsets[11]) ?? 0,
|
||||||
|
quotaUsageInBytes: reader.readLongOrNull(offsets[12]) ?? 0,
|
||||||
|
updatedAt: reader.readDateTime(offsets[13]),
|
||||||
);
|
);
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
@ -186,22 +206,28 @@ P _userDeserializeProp<P>(
|
|||||||
case 1:
|
case 1:
|
||||||
return (reader.readString(offset)) as P;
|
return (reader.readString(offset)) as P;
|
||||||
case 2:
|
case 2:
|
||||||
return (reader.readString(offset)) as P;
|
|
||||||
case 3:
|
|
||||||
return (reader.readBoolOrNull(offset) ?? false) as P;
|
|
||||||
case 4:
|
|
||||||
return (reader.readBool(offset)) as P;
|
return (reader.readBool(offset)) as P;
|
||||||
case 5:
|
case 3:
|
||||||
|
return (reader.readString(offset)) as P;
|
||||||
|
case 4:
|
||||||
return (reader.readBoolOrNull(offset) ?? false) as P;
|
return (reader.readBoolOrNull(offset) ?? false) as P;
|
||||||
|
case 5:
|
||||||
|
return (reader.readBool(offset)) as P;
|
||||||
case 6:
|
case 6:
|
||||||
return (reader.readBoolOrNull(offset) ?? false) as P;
|
return (reader.readBoolOrNull(offset) ?? false) as P;
|
||||||
case 7:
|
case 7:
|
||||||
return (reader.readBoolOrNull(offset) ?? true) as P;
|
return (reader.readBoolOrNull(offset) ?? false) as P;
|
||||||
case 8:
|
case 8:
|
||||||
return (reader.readString(offset)) as P;
|
return (reader.readBoolOrNull(offset) ?? true) as P;
|
||||||
case 9:
|
case 9:
|
||||||
return (reader.readStringOrNull(offset) ?? '') as P;
|
return (reader.readString(offset)) as P;
|
||||||
case 10:
|
case 10:
|
||||||
|
return (reader.readStringOrNull(offset) ?? '') as P;
|
||||||
|
case 11:
|
||||||
|
return (reader.readLongOrNull(offset) ?? 0) as P;
|
||||||
|
case 12:
|
||||||
|
return (reader.readLongOrNull(offset) ?? 0) as P;
|
||||||
|
case 13:
|
||||||
return (reader.readDateTime(offset)) as P;
|
return (reader.readDateTime(offset)) as P;
|
||||||
default:
|
default:
|
||||||
throw IsarError('Unknown property with id $propertyId');
|
throw IsarError('Unknown property with id $propertyId');
|
||||||
@ -601,6 +627,15 @@ extension UserQueryFilter on QueryBuilder<User, User, QFilterCondition> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> hasQuotaEqualTo(bool value) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.equalTo(
|
||||||
|
property: r'hasQuota',
|
||||||
|
value: value,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, User, QAfterFilterCondition> idEqualTo(
|
QueryBuilder<User, User, QAfterFilterCondition> idEqualTo(
|
||||||
String value, {
|
String value, {
|
||||||
bool caseSensitive = true,
|
bool caseSensitive = true,
|
||||||
@ -1088,6 +1123,112 @@ extension UserQueryFilter on QueryBuilder<User, User, QFilterCondition> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> quotaSizeInBytesEqualTo(
|
||||||
|
int value) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.equalTo(
|
||||||
|
property: r'quotaSizeInBytes',
|
||||||
|
value: value,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> quotaSizeInBytesGreaterThan(
|
||||||
|
int value, {
|
||||||
|
bool include = false,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||||
|
include: include,
|
||||||
|
property: r'quotaSizeInBytes',
|
||||||
|
value: value,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> quotaSizeInBytesLessThan(
|
||||||
|
int value, {
|
||||||
|
bool include = false,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.lessThan(
|
||||||
|
include: include,
|
||||||
|
property: r'quotaSizeInBytes',
|
||||||
|
value: value,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> quotaSizeInBytesBetween(
|
||||||
|
int lower,
|
||||||
|
int upper, {
|
||||||
|
bool includeLower = true,
|
||||||
|
bool includeUpper = true,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.between(
|
||||||
|
property: r'quotaSizeInBytes',
|
||||||
|
lower: lower,
|
||||||
|
includeLower: includeLower,
|
||||||
|
upper: upper,
|
||||||
|
includeUpper: includeUpper,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> quotaUsageInBytesEqualTo(
|
||||||
|
int value) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.equalTo(
|
||||||
|
property: r'quotaUsageInBytes',
|
||||||
|
value: value,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> quotaUsageInBytesGreaterThan(
|
||||||
|
int value, {
|
||||||
|
bool include = false,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.greaterThan(
|
||||||
|
include: include,
|
||||||
|
property: r'quotaUsageInBytes',
|
||||||
|
value: value,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> quotaUsageInBytesLessThan(
|
||||||
|
int value, {
|
||||||
|
bool include = false,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.lessThan(
|
||||||
|
include: include,
|
||||||
|
property: r'quotaUsageInBytes',
|
||||||
|
value: value,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterFilterCondition> quotaUsageInBytesBetween(
|
||||||
|
int lower,
|
||||||
|
int upper, {
|
||||||
|
bool includeLower = true,
|
||||||
|
bool includeUpper = true,
|
||||||
|
}) {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addFilterCondition(FilterCondition.between(
|
||||||
|
property: r'quotaUsageInBytes',
|
||||||
|
lower: lower,
|
||||||
|
includeLower: includeLower,
|
||||||
|
upper: upper,
|
||||||
|
includeUpper: includeUpper,
|
||||||
|
));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, User, QAfterFilterCondition> updatedAtEqualTo(
|
QueryBuilder<User, User, QAfterFilterCondition> updatedAtEqualTo(
|
||||||
DateTime value) {
|
DateTime value) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
@ -1282,6 +1423,18 @@ extension UserQuerySortBy on QueryBuilder<User, User, QSortBy> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> sortByHasQuota() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'hasQuota', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> sortByHasQuotaDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'hasQuota', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, User, QAfterSortBy> sortById() {
|
QueryBuilder<User, User, QAfterSortBy> sortById() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'id', Sort.asc);
|
return query.addSortBy(r'id', Sort.asc);
|
||||||
@ -1378,6 +1531,30 @@ extension UserQuerySortBy on QueryBuilder<User, User, QSortBy> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> sortByQuotaSizeInBytes() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'quotaSizeInBytes', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> sortByQuotaSizeInBytesDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'quotaSizeInBytes', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> sortByQuotaUsageInBytes() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'quotaUsageInBytes', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> sortByQuotaUsageInBytesDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'quotaUsageInBytes', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, User, QAfterSortBy> sortByUpdatedAt() {
|
QueryBuilder<User, User, QAfterSortBy> sortByUpdatedAt() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'updatedAt', Sort.asc);
|
return query.addSortBy(r'updatedAt', Sort.asc);
|
||||||
@ -1416,6 +1593,18 @@ extension UserQuerySortThenBy on QueryBuilder<User, User, QSortThenBy> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> thenByHasQuota() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'hasQuota', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> thenByHasQuotaDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'hasQuota', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, User, QAfterSortBy> thenById() {
|
QueryBuilder<User, User, QAfterSortBy> thenById() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'id', Sort.asc);
|
return query.addSortBy(r'id', Sort.asc);
|
||||||
@ -1524,6 +1713,30 @@ extension UserQuerySortThenBy on QueryBuilder<User, User, QSortThenBy> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> thenByQuotaSizeInBytes() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'quotaSizeInBytes', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> thenByQuotaSizeInBytesDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'quotaSizeInBytes', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> thenByQuotaUsageInBytes() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'quotaUsageInBytes', Sort.asc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QAfterSortBy> thenByQuotaUsageInBytesDesc() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addSortBy(r'quotaUsageInBytes', Sort.desc);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, User, QAfterSortBy> thenByUpdatedAt() {
|
QueryBuilder<User, User, QAfterSortBy> thenByUpdatedAt() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addSortBy(r'updatedAt', Sort.asc);
|
return query.addSortBy(r'updatedAt', Sort.asc);
|
||||||
@ -1551,6 +1764,12 @@ extension UserQueryWhereDistinct on QueryBuilder<User, User, QDistinct> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QDistinct> distinctByHasQuota() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addDistinctBy(r'hasQuota');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, User, QDistinct> distinctById(
|
QueryBuilder<User, User, QDistinct> distinctById(
|
||||||
{bool caseSensitive = true}) {
|
{bool caseSensitive = true}) {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
@ -1603,6 +1822,18 @@ extension UserQueryWhereDistinct on QueryBuilder<User, User, QDistinct> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QDistinct> distinctByQuotaSizeInBytes() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addDistinctBy(r'quotaSizeInBytes');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, User, QDistinct> distinctByQuotaUsageInBytes() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addDistinctBy(r'quotaUsageInBytes');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, User, QDistinct> distinctByUpdatedAt() {
|
QueryBuilder<User, User, QDistinct> distinctByUpdatedAt() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addDistinctBy(r'updatedAt');
|
return query.addDistinctBy(r'updatedAt');
|
||||||
@ -1629,6 +1860,12 @@ extension UserQueryProperty on QueryBuilder<User, User, QQueryProperty> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, bool, QQueryOperations> hasQuotaProperty() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addPropertyName(r'hasQuota');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, String, QQueryOperations> idProperty() {
|
QueryBuilder<User, String, QQueryOperations> idProperty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addPropertyName(r'id');
|
return query.addPropertyName(r'id');
|
||||||
@ -1677,6 +1914,18 @@ extension UserQueryProperty on QueryBuilder<User, User, QQueryProperty> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, int, QQueryOperations> quotaSizeInBytesProperty() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addPropertyName(r'quotaSizeInBytes');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryBuilder<User, int, QQueryOperations> quotaUsageInBytesProperty() {
|
||||||
|
return QueryBuilder.apply(this, (query) {
|
||||||
|
return query.addPropertyName(r'quotaUsageInBytes');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
QueryBuilder<User, DateTime, QQueryOperations> updatedAtProperty() {
|
QueryBuilder<User, DateTime, QQueryOperations> updatedAtProperty() {
|
||||||
return QueryBuilder.apply(this, (query) {
|
return QueryBuilder.apply(this, (query) {
|
||||||
return query.addPropertyName(r'updatedAt');
|
return query.addPropertyName(r'updatedAt');
|
||||||
|
@ -3,18 +3,33 @@ import 'dart:async';
|
|||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:immich_mobile/shared/models/store.dart';
|
import 'package:immich_mobile/shared/models/store.dart';
|
||||||
import 'package:immich_mobile/shared/models/user.dart';
|
import 'package:immich_mobile/shared/models/user.dart';
|
||||||
|
import 'package:immich_mobile/shared/providers/api.provider.dart';
|
||||||
import 'package:immich_mobile/shared/providers/db.provider.dart';
|
import 'package:immich_mobile/shared/providers/db.provider.dart';
|
||||||
|
import 'package:immich_mobile/shared/services/api.service.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
|
||||||
class CurrentUserProvider extends StateNotifier<User?> {
|
class CurrentUserProvider extends StateNotifier<User?> {
|
||||||
CurrentUserProvider() : super(null) {
|
CurrentUserProvider(this._apiService) : super(null) {
|
||||||
state = Store.tryGet(StoreKey.currentUser);
|
state = Store.tryGet(StoreKey.currentUser);
|
||||||
streamSub =
|
streamSub =
|
||||||
Store.watch(StoreKey.currentUser).listen((user) => state = user);
|
Store.watch(StoreKey.currentUser).listen((user) => state = user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final ApiService _apiService;
|
||||||
late final StreamSubscription<User?> streamSub;
|
late final StreamSubscription<User?> streamSub;
|
||||||
|
|
||||||
|
refresh() async {
|
||||||
|
try {
|
||||||
|
final user = await _apiService.userApi.getMyUserInfo();
|
||||||
|
if (user != null) {
|
||||||
|
Store.put(
|
||||||
|
StoreKey.currentUser,
|
||||||
|
User.fromUserDto(user),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
streamSub.cancel();
|
streamSub.cancel();
|
||||||
@ -24,7 +39,9 @@ class CurrentUserProvider extends StateNotifier<User?> {
|
|||||||
|
|
||||||
final currentUserProvider =
|
final currentUserProvider =
|
||||||
StateNotifierProvider<CurrentUserProvider, User?>((ref) {
|
StateNotifierProvider<CurrentUserProvider, User?>((ref) {
|
||||||
return CurrentUserProvider();
|
return CurrentUserProvider(
|
||||||
|
ref.watch(apiServiceProvider),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
class TimelineUserIdsProvider extends StateNotifier<List<int>> {
|
class TimelineUserIdsProvider extends StateNotifier<List<int>> {
|
||||||
|
@ -15,6 +15,7 @@ import 'package:immich_mobile/shared/providers/websocket.provider.dart';
|
|||||||
import 'package:immich_mobile/shared/ui/app_bar_dialog/app_bar_profile_info.dart';
|
import 'package:immich_mobile/shared/ui/app_bar_dialog/app_bar_profile_info.dart';
|
||||||
import 'package:immich_mobile/shared/ui/app_bar_dialog/app_bar_server_info.dart';
|
import 'package:immich_mobile/shared/ui/app_bar_dialog/app_bar_server_info.dart';
|
||||||
import 'package:immich_mobile/shared/ui/confirm_dialog.dart';
|
import 'package:immich_mobile/shared/ui/confirm_dialog.dart';
|
||||||
|
import 'package:immich_mobile/utils/bytes_units.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class ImmichAppBarDialog extends HookConsumerWidget {
|
class ImmichAppBarDialog extends HookConsumerWidget {
|
||||||
@ -31,6 +32,7 @@ class ImmichAppBarDialog extends HookConsumerWidget {
|
|||||||
useEffect(
|
useEffect(
|
||||||
() {
|
() {
|
||||||
ref.read(backupProvider.notifier).updateServerInfo();
|
ref.read(backupProvider.notifier).updateServerInfo();
|
||||||
|
ref.read(currentUserProvider.notifier).refresh();
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
[user],
|
[user],
|
||||||
@ -132,6 +134,16 @@ class ImmichAppBarDialog extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildStorageInformation() {
|
Widget buildStorageInformation() {
|
||||||
|
var percentage = backupState.serverInfo.diskUsagePercentage / 100;
|
||||||
|
var usedDiskSpace = backupState.serverInfo.diskUse;
|
||||||
|
var totalDiskSpace = backupState.serverInfo.diskSize;
|
||||||
|
|
||||||
|
if (user != null && user.hasQuota) {
|
||||||
|
usedDiskSpace = formatBytes(user.quotaUsageInBytes);
|
||||||
|
totalDiskSpace = formatBytes(user.quotaSizeInBytes);
|
||||||
|
percentage = user.quotaUsageInBytes / user.quotaSizeInBytes;
|
||||||
|
}
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 3),
|
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 3),
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -163,7 +175,7 @@ class ImmichAppBarDialog extends HookConsumerWidget {
|
|||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: LinearProgressIndicator(
|
child: LinearProgressIndicator(
|
||||||
minHeight: 5.0,
|
minHeight: 5.0,
|
||||||
value: backupState.serverInfo.diskUsagePercentage / 100.0,
|
value: percentage,
|
||||||
backgroundColor: Colors.grey,
|
backgroundColor: Colors.grey,
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
),
|
),
|
||||||
@ -173,8 +185,8 @@ class ImmichAppBarDialog extends HookConsumerWidget {
|
|||||||
child:
|
child:
|
||||||
const Text('backup_controller_page_storage_format').tr(
|
const Text('backup_controller_page_storage_format').tr(
|
||||||
args: [
|
args: [
|
||||||
backupState.serverInfo.diskUse,
|
usedDiskSpace,
|
||||||
backupState.serverInfo.diskSize,
|
totalDiskSpace,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
10
mobile/openapi/lib/model/partner_response_dto.dart
generated
10
mobile/openapi/lib/model/partner_response_dto.dart
generated
@ -70,7 +70,7 @@ class PartnerResponseDto {
|
|||||||
|
|
||||||
int? quotaSizeInBytes;
|
int? quotaSizeInBytes;
|
||||||
|
|
||||||
int quotaUsageInBytes;
|
int? quotaUsageInBytes;
|
||||||
|
|
||||||
bool shouldChangePassword;
|
bool shouldChangePassword;
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ class PartnerResponseDto {
|
|||||||
(oauthId.hashCode) +
|
(oauthId.hashCode) +
|
||||||
(profileImagePath.hashCode) +
|
(profileImagePath.hashCode) +
|
||||||
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
|
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
|
||||||
(quotaUsageInBytes.hashCode) +
|
(quotaUsageInBytes == null ? 0 : quotaUsageInBytes!.hashCode) +
|
||||||
(shouldChangePassword.hashCode) +
|
(shouldChangePassword.hashCode) +
|
||||||
(storageLabel == null ? 0 : storageLabel!.hashCode) +
|
(storageLabel == null ? 0 : storageLabel!.hashCode) +
|
||||||
(updatedAt.hashCode);
|
(updatedAt.hashCode);
|
||||||
@ -157,7 +157,11 @@ class PartnerResponseDto {
|
|||||||
} else {
|
} else {
|
||||||
// json[r'quotaSizeInBytes'] = null;
|
// json[r'quotaSizeInBytes'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.quotaUsageInBytes != null) {
|
||||||
json[r'quotaUsageInBytes'] = this.quotaUsageInBytes;
|
json[r'quotaUsageInBytes'] = this.quotaUsageInBytes;
|
||||||
|
} else {
|
||||||
|
// json[r'quotaUsageInBytes'] = null;
|
||||||
|
}
|
||||||
json[r'shouldChangePassword'] = this.shouldChangePassword;
|
json[r'shouldChangePassword'] = this.shouldChangePassword;
|
||||||
if (this.storageLabel != null) {
|
if (this.storageLabel != null) {
|
||||||
json[r'storageLabel'] = this.storageLabel;
|
json[r'storageLabel'] = this.storageLabel;
|
||||||
@ -189,7 +193,7 @@ class PartnerResponseDto {
|
|||||||
oauthId: mapValueOfType<String>(json, r'oauthId')!,
|
oauthId: mapValueOfType<String>(json, r'oauthId')!,
|
||||||
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
||||||
quotaSizeInBytes: mapValueOfType<int>(json, r'quotaSizeInBytes'),
|
quotaSizeInBytes: mapValueOfType<int>(json, r'quotaSizeInBytes'),
|
||||||
quotaUsageInBytes: mapValueOfType<int>(json, r'quotaUsageInBytes')!,
|
quotaUsageInBytes: mapValueOfType<int>(json, r'quotaUsageInBytes'),
|
||||||
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
|
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
|
||||||
storageLabel: mapValueOfType<String>(json, r'storageLabel'),
|
storageLabel: mapValueOfType<String>(json, r'storageLabel'),
|
||||||
updatedAt: mapDateTime(json, r'updatedAt', '')!,
|
updatedAt: mapDateTime(json, r'updatedAt', '')!,
|
||||||
|
10
mobile/openapi/lib/model/user_response_dto.dart
generated
10
mobile/openapi/lib/model/user_response_dto.dart
generated
@ -61,7 +61,7 @@ class UserResponseDto {
|
|||||||
|
|
||||||
int? quotaSizeInBytes;
|
int? quotaSizeInBytes;
|
||||||
|
|
||||||
int quotaUsageInBytes;
|
int? quotaUsageInBytes;
|
||||||
|
|
||||||
bool shouldChangePassword;
|
bool shouldChangePassword;
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ class UserResponseDto {
|
|||||||
(oauthId.hashCode) +
|
(oauthId.hashCode) +
|
||||||
(profileImagePath.hashCode) +
|
(profileImagePath.hashCode) +
|
||||||
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
|
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
|
||||||
(quotaUsageInBytes.hashCode) +
|
(quotaUsageInBytes == null ? 0 : quotaUsageInBytes!.hashCode) +
|
||||||
(shouldChangePassword.hashCode) +
|
(shouldChangePassword.hashCode) +
|
||||||
(storageLabel == null ? 0 : storageLabel!.hashCode) +
|
(storageLabel == null ? 0 : storageLabel!.hashCode) +
|
||||||
(updatedAt.hashCode);
|
(updatedAt.hashCode);
|
||||||
@ -141,7 +141,11 @@ class UserResponseDto {
|
|||||||
} else {
|
} else {
|
||||||
// json[r'quotaSizeInBytes'] = null;
|
// json[r'quotaSizeInBytes'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.quotaUsageInBytes != null) {
|
||||||
json[r'quotaUsageInBytes'] = this.quotaUsageInBytes;
|
json[r'quotaUsageInBytes'] = this.quotaUsageInBytes;
|
||||||
|
} else {
|
||||||
|
// json[r'quotaUsageInBytes'] = null;
|
||||||
|
}
|
||||||
json[r'shouldChangePassword'] = this.shouldChangePassword;
|
json[r'shouldChangePassword'] = this.shouldChangePassword;
|
||||||
if (this.storageLabel != null) {
|
if (this.storageLabel != null) {
|
||||||
json[r'storageLabel'] = this.storageLabel;
|
json[r'storageLabel'] = this.storageLabel;
|
||||||
@ -172,7 +176,7 @@ class UserResponseDto {
|
|||||||
oauthId: mapValueOfType<String>(json, r'oauthId')!,
|
oauthId: mapValueOfType<String>(json, r'oauthId')!,
|
||||||
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
||||||
quotaSizeInBytes: mapValueOfType<int>(json, r'quotaSizeInBytes'),
|
quotaSizeInBytes: mapValueOfType<int>(json, r'quotaSizeInBytes'),
|
||||||
quotaUsageInBytes: mapValueOfType<int>(json, r'quotaUsageInBytes')!,
|
quotaUsageInBytes: mapValueOfType<int>(json, r'quotaUsageInBytes'),
|
||||||
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
|
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
|
||||||
storageLabel: mapValueOfType<String>(json, r'storageLabel'),
|
storageLabel: mapValueOfType<String>(json, r'storageLabel'),
|
||||||
updatedAt: mapDateTime(json, r'updatedAt', '')!,
|
updatedAt: mapDateTime(json, r'updatedAt', '')!,
|
||||||
|
@ -37,10 +37,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: "7b875fd4a20b165a3084bd2d210439b22ebc653f21cea4842729c0c30c82596b"
|
sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.4.9"
|
version: "3.4.10"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -739,10 +739,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271"
|
sha256: "004a2e90ce080f8627b5a04aecb4cdfac87d2c3f3b520aa291260be5a32c033d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.3"
|
version: "4.1.4"
|
||||||
image_picker:
|
image_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -8204,6 +8204,7 @@
|
|||||||
},
|
},
|
||||||
"quotaUsageInBytes": {
|
"quotaUsageInBytes": {
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
|
"nullable": true,
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"shouldChangePassword": {
|
"shouldChangePassword": {
|
||||||
@ -9912,6 +9913,7 @@
|
|||||||
},
|
},
|
||||||
"quotaUsageInBytes": {
|
"quotaUsageInBytes": {
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
|
"nullable": true,
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"shouldChangePassword": {
|
"shouldChangePassword": {
|
||||||
|
4
open-api/typescript-sdk/client/api.ts
generated
4
open-api/typescript-sdk/client/api.ts
generated
@ -2496,7 +2496,7 @@ export interface PartnerResponseDto {
|
|||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof PartnerResponseDto
|
* @memberof PartnerResponseDto
|
||||||
*/
|
*/
|
||||||
'quotaUsageInBytes': number;
|
'quotaUsageInBytes': number | null;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
@ -4770,7 +4770,7 @@ export interface UserResponseDto {
|
|||||||
* @type {number}
|
* @type {number}
|
||||||
* @memberof UserResponseDto
|
* @memberof UserResponseDto
|
||||||
*/
|
*/
|
||||||
'quotaUsageInBytes': number;
|
'quotaUsageInBytes': number | null;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
@ -36,7 +36,7 @@ export class UserResponseDto extends UserDto {
|
|||||||
@ApiProperty({ type: 'integer', format: 'int64' })
|
@ApiProperty({ type: 'integer', format: 'int64' })
|
||||||
quotaSizeInBytes!: number | null;
|
quotaSizeInBytes!: number | null;
|
||||||
@ApiProperty({ type: 'integer', format: 'int64' })
|
@ApiProperty({ type: 'integer', format: 'int64' })
|
||||||
quotaUsageInBytes!: number;
|
quotaUsageInBytes!: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const mapSimpleUser = (entity: UserEntity): UserDto => {
|
export const mapSimpleUser = (entity: UserEntity): UserDto => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user