refactor(server)!: remove changeExpiryTime

refactor/drop-changeExpiryTime
timonrieger 2026-06-03 23:30:36 +02:00
parent e98201232a
commit bd0fc2cc86
No known key found for this signature in database
5 changed files with 2 additions and 31 deletions

View File

@ -15,7 +15,6 @@ class SharedLinkEditDto {
SharedLinkEditDto({ SharedLinkEditDto({
this.allowDownload = const Optional.absent(), this.allowDownload = const Optional.absent(),
this.allowUpload = const Optional.absent(), this.allowUpload = const Optional.absent(),
this.changeExpiryTime = const Optional.absent(),
this.description = const Optional.absent(), this.description = const Optional.absent(),
this.expiresAt = const Optional.absent(), this.expiresAt = const Optional.absent(),
this.password = const Optional.absent(), this.password = const Optional.absent(),
@ -41,15 +40,6 @@ class SharedLinkEditDto {
/// ///
Optional<bool?> allowUpload; Optional<bool?> allowUpload;
/// Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this.
///
/// 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.
///
Optional<bool?> changeExpiryTime;
/// Link description /// Link description
Optional<String?> description; Optional<String?> description;
@ -75,7 +65,6 @@ class SharedLinkEditDto {
bool operator ==(Object other) => identical(this, other) || other is SharedLinkEditDto && bool operator ==(Object other) => identical(this, other) || other is SharedLinkEditDto &&
other.allowDownload == allowDownload && other.allowDownload == allowDownload &&
other.allowUpload == allowUpload && other.allowUpload == allowUpload &&
other.changeExpiryTime == changeExpiryTime &&
other.description == description && other.description == description &&
other.expiresAt == expiresAt && other.expiresAt == expiresAt &&
other.password == password && other.password == password &&
@ -87,7 +76,6 @@ class SharedLinkEditDto {
// ignore: unnecessary_parenthesis // ignore: unnecessary_parenthesis
(allowDownload == null ? 0 : allowDownload!.hashCode) + (allowDownload == null ? 0 : allowDownload!.hashCode) +
(allowUpload == null ? 0 : allowUpload!.hashCode) + (allowUpload == null ? 0 : allowUpload!.hashCode) +
(changeExpiryTime == null ? 0 : changeExpiryTime!.hashCode) +
(description == null ? 0 : description!.hashCode) + (description == null ? 0 : description!.hashCode) +
(expiresAt == null ? 0 : expiresAt!.hashCode) + (expiresAt == null ? 0 : expiresAt!.hashCode) +
(password == null ? 0 : password!.hashCode) + (password == null ? 0 : password!.hashCode) +
@ -95,7 +83,7 @@ class SharedLinkEditDto {
(slug == null ? 0 : slug!.hashCode); (slug == null ? 0 : slug!.hashCode);
@override @override
String toString() => 'SharedLinkEditDto[allowDownload=$allowDownload, allowUpload=$allowUpload, changeExpiryTime=$changeExpiryTime, description=$description, expiresAt=$expiresAt, password=$password, showMetadata=$showMetadata, slug=$slug]'; String toString() => 'SharedLinkEditDto[allowDownload=$allowDownload, allowUpload=$allowUpload, description=$description, expiresAt=$expiresAt, password=$password, showMetadata=$showMetadata, slug=$slug]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -107,10 +95,6 @@ class SharedLinkEditDto {
final value = this.allowUpload.value; final value = this.allowUpload.value;
json[r'allowUpload'] = value; json[r'allowUpload'] = value;
} }
if (this.changeExpiryTime.isPresent) {
final value = this.changeExpiryTime.value;
json[r'changeExpiryTime'] = value;
}
if (this.description.isPresent) { if (this.description.isPresent) {
final value = this.description.value; final value = this.description.value;
json[r'description'] = value; json[r'description'] = value;
@ -147,7 +131,6 @@ class SharedLinkEditDto {
return SharedLinkEditDto( return SharedLinkEditDto(
allowDownload: json.containsKey(r'allowDownload') ? Optional.present(mapValueOfType<bool>(json, r'allowDownload')) : const Optional.absent(), allowDownload: json.containsKey(r'allowDownload') ? Optional.present(mapValueOfType<bool>(json, r'allowDownload')) : const Optional.absent(),
allowUpload: json.containsKey(r'allowUpload') ? Optional.present(mapValueOfType<bool>(json, r'allowUpload')) : const Optional.absent(), allowUpload: json.containsKey(r'allowUpload') ? Optional.present(mapValueOfType<bool>(json, r'allowUpload')) : const Optional.absent(),
changeExpiryTime: json.containsKey(r'changeExpiryTime') ? Optional.present(mapValueOfType<bool>(json, r'changeExpiryTime')) : const Optional.absent(),
description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(), description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
expiresAt: json.containsKey(r'expiresAt') ? Optional.present(mapDateTime(json, r'expiresAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(), expiresAt: json.containsKey(r'expiresAt') ? Optional.present(mapDateTime(json, r'expiresAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
password: json.containsKey(r'password') ? Optional.present(mapValueOfType<String>(json, r'password')) : const Optional.absent(), password: json.containsKey(r'password') ? Optional.present(mapValueOfType<String>(json, r'password')) : const Optional.absent(),

View File

@ -22197,10 +22197,6 @@
"description": "Allow uploads", "description": "Allow uploads",
"type": "boolean" "type": "boolean"
}, },
"changeExpiryTime": {
"description": "Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this.",
"type": "boolean"
},
"description": { "description": {
"description": "Link description", "description": "Link description",
"nullable": true, "nullable": true,

View File

@ -2192,8 +2192,6 @@ export type SharedLinkEditDto = {
allowDownload?: boolean; allowDownload?: boolean;
/** Allow uploads */ /** Allow uploads */
allowUpload?: boolean; allowUpload?: boolean;
/** Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this. */
changeExpiryTime?: boolean;
/** Link description */ /** Link description */
description?: string | null; description?: string | null;
/** Expiration date */ /** Expiration date */

View File

@ -42,12 +42,6 @@ const SharedLinkEditSchema = z
allowUpload: z.boolean().optional().describe('Allow uploads'), allowUpload: z.boolean().optional().describe('Allow uploads'),
allowDownload: z.boolean().optional().describe('Allow downloads'), allowDownload: z.boolean().optional().describe('Allow downloads'),
showMetadata: z.boolean().optional().describe('Show metadata'), showMetadata: z.boolean().optional().describe('Show metadata'),
changeExpiryTime: z
.boolean()
.optional()
.describe(
'Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this.',
),
}) })
.meta({ id: 'SharedLinkEditDto' }); .meta({ id: 'SharedLinkEditDto' });

View File

@ -124,7 +124,7 @@ export class SharedLinkService extends BaseService {
userId: auth.user.id, userId: auth.user.id,
description: dto.description, description: dto.description,
password: dto.password, password: dto.password,
expiresAt: dto.changeExpiryTime && !dto.expiresAt ? null : dto.expiresAt, expiresAt: dto.expiresAt,
allowUpload: dto.allowUpload, allowUpload: dto.allowUpload,
allowDownload: dto.allowDownload, allowDownload: dto.allowDownload,
showExif: dto.showMetadata, showExif: dto.showMetadata,