From bd0fc2cc86f7629cc14c3fd55ef78752181559e0 Mon Sep 17 00:00:00 2001 From: timonrieger Date: Wed, 3 Jun 2026 23:30:36 +0200 Subject: [PATCH] refactor(server)!: remove changeExpiryTime --- .../lib/model/shared_link_edit_dto.dart | 19 +------------------ open-api/immich-openapi-specs.json | 4 ---- packages/sdk/src/fetch-client.ts | 2 -- server/src/dtos/shared-link.dto.ts | 6 ------ server/src/services/shared-link.service.ts | 2 +- 5 files changed, 2 insertions(+), 31 deletions(-) diff --git a/mobile/openapi/lib/model/shared_link_edit_dto.dart b/mobile/openapi/lib/model/shared_link_edit_dto.dart index 0d6df3c8f9..a38d28b79b 100644 --- a/mobile/openapi/lib/model/shared_link_edit_dto.dart +++ b/mobile/openapi/lib/model/shared_link_edit_dto.dart @@ -15,7 +15,6 @@ class SharedLinkEditDto { SharedLinkEditDto({ this.allowDownload = const Optional.absent(), this.allowUpload = const Optional.absent(), - this.changeExpiryTime = const Optional.absent(), this.description = const Optional.absent(), this.expiresAt = const Optional.absent(), this.password = const Optional.absent(), @@ -41,15 +40,6 @@ class SharedLinkEditDto { /// Optional 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 changeExpiryTime; - /// Link description Optional description; @@ -75,7 +65,6 @@ class SharedLinkEditDto { bool operator ==(Object other) => identical(this, other) || other is SharedLinkEditDto && other.allowDownload == allowDownload && other.allowUpload == allowUpload && - other.changeExpiryTime == changeExpiryTime && other.description == description && other.expiresAt == expiresAt && other.password == password && @@ -87,7 +76,6 @@ class SharedLinkEditDto { // ignore: unnecessary_parenthesis (allowDownload == null ? 0 : allowDownload!.hashCode) + (allowUpload == null ? 0 : allowUpload!.hashCode) + - (changeExpiryTime == null ? 0 : changeExpiryTime!.hashCode) + (description == null ? 0 : description!.hashCode) + (expiresAt == null ? 0 : expiresAt!.hashCode) + (password == null ? 0 : password!.hashCode) + @@ -95,7 +83,7 @@ class SharedLinkEditDto { (slug == null ? 0 : slug!.hashCode); @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 toJson() { final json = {}; @@ -107,10 +95,6 @@ class SharedLinkEditDto { final value = this.allowUpload.value; json[r'allowUpload'] = value; } - if (this.changeExpiryTime.isPresent) { - final value = this.changeExpiryTime.value; - json[r'changeExpiryTime'] = value; - } if (this.description.isPresent) { final value = this.description.value; json[r'description'] = value; @@ -147,7 +131,6 @@ class SharedLinkEditDto { return SharedLinkEditDto( allowDownload: json.containsKey(r'allowDownload') ? Optional.present(mapValueOfType(json, r'allowDownload')) : const Optional.absent(), allowUpload: json.containsKey(r'allowUpload') ? Optional.present(mapValueOfType(json, r'allowUpload')) : const Optional.absent(), - changeExpiryTime: json.containsKey(r'changeExpiryTime') ? Optional.present(mapValueOfType(json, r'changeExpiryTime')) : const Optional.absent(), description: json.containsKey(r'description') ? Optional.present(mapValueOfType(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(), password: json.containsKey(r'password') ? Optional.present(mapValueOfType(json, r'password')) : const Optional.absent(), diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 33eaf13fc2..d8dd7b1a1b 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -22197,10 +22197,6 @@ "description": "Allow uploads", "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": "Link description", "nullable": true, diff --git a/packages/sdk/src/fetch-client.ts b/packages/sdk/src/fetch-client.ts index 89d0e513d8..3e76872b6f 100644 --- a/packages/sdk/src/fetch-client.ts +++ b/packages/sdk/src/fetch-client.ts @@ -2192,8 +2192,6 @@ export type SharedLinkEditDto = { allowDownload?: boolean; /** Allow uploads */ 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 */ description?: string | null; /** Expiration date */ diff --git a/server/src/dtos/shared-link.dto.ts b/server/src/dtos/shared-link.dto.ts index 2e466c5014..2facb26c99 100644 --- a/server/src/dtos/shared-link.dto.ts +++ b/server/src/dtos/shared-link.dto.ts @@ -42,12 +42,6 @@ const SharedLinkEditSchema = z allowUpload: z.boolean().optional().describe('Allow uploads'), allowDownload: z.boolean().optional().describe('Allow downloads'), 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' }); diff --git a/server/src/services/shared-link.service.ts b/server/src/services/shared-link.service.ts index 0643a432b8..79e4b23e6a 100644 --- a/server/src/services/shared-link.service.ts +++ b/server/src/services/shared-link.service.ts @@ -124,7 +124,7 @@ export class SharedLinkService extends BaseService { userId: auth.user.id, description: dto.description, password: dto.password, - expiresAt: dto.changeExpiryTime && !dto.expiresAt ? null : dto.expiresAt, + expiresAt: dto.expiresAt, allowUpload: dto.allowUpload, allowDownload: dto.allowDownload, showExif: dto.showMetadata,