mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): shared links (#1385)
* refactor(server): shared links * chore: tests * fix: bugs and tests * fix: missed one expired at * fix: standardize file upload checks * test: lower flutter version Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
parent
f64db3a2f9
commit
8f304b8157
70 changed files with 1481 additions and 1057 deletions
45
mobile/openapi/lib/model/edit_shared_link_dto.dart
generated
45
mobile/openapi/lib/model/edit_shared_link_dto.dart
generated
|
|
@ -14,11 +14,10 @@ class EditSharedLinkDto {
|
|||
/// Returns a new [EditSharedLinkDto] instance.
|
||||
EditSharedLinkDto({
|
||||
this.description,
|
||||
this.expiredAt,
|
||||
this.expiresAt,
|
||||
this.allowUpload,
|
||||
this.allowDownload,
|
||||
this.showExif,
|
||||
this.isEditExpireTime,
|
||||
});
|
||||
|
||||
///
|
||||
|
|
@ -29,13 +28,7 @@ class EditSharedLinkDto {
|
|||
///
|
||||
String? description;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
String? expiredAt;
|
||||
String? expiresAt;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
|
|
@ -61,35 +54,25 @@ class EditSharedLinkDto {
|
|||
///
|
||||
bool? showExif;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? isEditExpireTime;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EditSharedLinkDto &&
|
||||
other.description == description &&
|
||||
other.expiredAt == expiredAt &&
|
||||
other.expiresAt == expiresAt &&
|
||||
other.allowUpload == allowUpload &&
|
||||
other.allowDownload == allowDownload &&
|
||||
other.showExif == showExif &&
|
||||
other.isEditExpireTime == isEditExpireTime;
|
||||
other.showExif == showExif;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(description == null ? 0 : description!.hashCode) +
|
||||
(expiredAt == null ? 0 : expiredAt!.hashCode) +
|
||||
(expiresAt == null ? 0 : expiresAt!.hashCode) +
|
||||
(allowUpload == null ? 0 : allowUpload!.hashCode) +
|
||||
(allowDownload == null ? 0 : allowDownload!.hashCode) +
|
||||
(showExif == null ? 0 : showExif!.hashCode) +
|
||||
(isEditExpireTime == null ? 0 : isEditExpireTime!.hashCode);
|
||||
(showExif == null ? 0 : showExif!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'EditSharedLinkDto[description=$description, expiredAt=$expiredAt, allowUpload=$allowUpload, allowDownload=$allowDownload, showExif=$showExif, isEditExpireTime=$isEditExpireTime]';
|
||||
String toString() => 'EditSharedLinkDto[description=$description, expiresAt=$expiresAt, allowUpload=$allowUpload, allowDownload=$allowDownload, showExif=$showExif]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
|
|
@ -98,10 +81,10 @@ class EditSharedLinkDto {
|
|||
} else {
|
||||
// json[r'description'] = null;
|
||||
}
|
||||
if (this.expiredAt != null) {
|
||||
json[r'expiredAt'] = this.expiredAt;
|
||||
if (this.expiresAt != null) {
|
||||
json[r'expiresAt'] = this.expiresAt;
|
||||
} else {
|
||||
// json[r'expiredAt'] = null;
|
||||
// json[r'expiresAt'] = null;
|
||||
}
|
||||
if (this.allowUpload != null) {
|
||||
json[r'allowUpload'] = this.allowUpload;
|
||||
|
|
@ -118,11 +101,6 @@ class EditSharedLinkDto {
|
|||
} else {
|
||||
// json[r'showExif'] = null;
|
||||
}
|
||||
if (this.isEditExpireTime != null) {
|
||||
json[r'isEditExpireTime'] = this.isEditExpireTime;
|
||||
} else {
|
||||
// json[r'isEditExpireTime'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
|
@ -146,11 +124,10 @@ class EditSharedLinkDto {
|
|||
|
||||
return EditSharedLinkDto(
|
||||
description: mapValueOfType<String>(json, r'description'),
|
||||
expiredAt: mapValueOfType<String>(json, r'expiredAt'),
|
||||
expiresAt: mapValueOfType<String>(json, r'expiresAt'),
|
||||
allowUpload: mapValueOfType<bool>(json, r'allowUpload'),
|
||||
allowDownload: mapValueOfType<bool>(json, r'allowDownload'),
|
||||
showExif: mapValueOfType<bool>(json, r'showExif'),
|
||||
isEditExpireTime: mapValueOfType<bool>(json, r'isEditExpireTime'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue