mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	feat(web/server) Add more options to public shared link (#1348)
* Added migration files * Added logic for shared album level * Added permission for EXIF * Update shared link response dto * Added condition to show download button * Create and edit link with new parameter: * Remove deadcode * PR feedback * More refactor * Move logic of allow original file to service * Simplify * Wording
This commit is contained in:
		@@ -16,6 +16,8 @@ class CreateAssetsShareLinkDto {
 | 
			
		||||
    this.assetIds = const [],
 | 
			
		||||
    this.expiredAt,
 | 
			
		||||
    this.allowUpload,
 | 
			
		||||
    this.allowDownload,
 | 
			
		||||
    this.showExif,
 | 
			
		||||
    this.description,
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
@@ -37,6 +39,22 @@ class CreateAssetsShareLinkDto {
 | 
			
		||||
  ///
 | 
			
		||||
  bool? allowUpload;
 | 
			
		||||
 | 
			
		||||
  ///
 | 
			
		||||
  /// 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? allowDownload;
 | 
			
		||||
 | 
			
		||||
  ///
 | 
			
		||||
  /// 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? 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
 | 
			
		||||
@@ -50,6 +68,8 @@ class CreateAssetsShareLinkDto {
 | 
			
		||||
     other.assetIds == assetIds &&
 | 
			
		||||
     other.expiredAt == expiredAt &&
 | 
			
		||||
     other.allowUpload == allowUpload &&
 | 
			
		||||
     other.allowDownload == allowDownload &&
 | 
			
		||||
     other.showExif == showExif &&
 | 
			
		||||
     other.description == description;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
@@ -58,10 +78,12 @@ class CreateAssetsShareLinkDto {
 | 
			
		||||
    (assetIds.hashCode) +
 | 
			
		||||
    (expiredAt == null ? 0 : expiredAt!.hashCode) +
 | 
			
		||||
    (allowUpload == null ? 0 : allowUpload!.hashCode) +
 | 
			
		||||
    (allowDownload == null ? 0 : allowDownload!.hashCode) +
 | 
			
		||||
    (showExif == null ? 0 : showExif!.hashCode) +
 | 
			
		||||
    (description == null ? 0 : description!.hashCode);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String toString() => 'CreateAssetsShareLinkDto[assetIds=$assetIds, expiredAt=$expiredAt, allowUpload=$allowUpload, description=$description]';
 | 
			
		||||
  String toString() => 'CreateAssetsShareLinkDto[assetIds=$assetIds, expiredAt=$expiredAt, allowUpload=$allowUpload, allowDownload=$allowDownload, showExif=$showExif, description=$description]';
 | 
			
		||||
 | 
			
		||||
  Map<String, dynamic> toJson() {
 | 
			
		||||
    final json = <String, dynamic>{};
 | 
			
		||||
@@ -76,6 +98,16 @@ class CreateAssetsShareLinkDto {
 | 
			
		||||
    } else {
 | 
			
		||||
      // json[r'allowUpload'] = null;
 | 
			
		||||
    }
 | 
			
		||||
    if (this.allowDownload != null) {
 | 
			
		||||
      json[r'allowDownload'] = this.allowDownload;
 | 
			
		||||
    } else {
 | 
			
		||||
      // json[r'allowDownload'] = null;
 | 
			
		||||
    }
 | 
			
		||||
    if (this.showExif != null) {
 | 
			
		||||
      json[r'showExif'] = this.showExif;
 | 
			
		||||
    } else {
 | 
			
		||||
      // json[r'showExif'] = null;
 | 
			
		||||
    }
 | 
			
		||||
    if (this.description != null) {
 | 
			
		||||
      json[r'description'] = this.description;
 | 
			
		||||
    } else {
 | 
			
		||||
@@ -108,6 +140,8 @@ class CreateAssetsShareLinkDto {
 | 
			
		||||
            : const [],
 | 
			
		||||
        expiredAt: mapValueOfType<String>(json, r'expiredAt'),
 | 
			
		||||
        allowUpload: mapValueOfType<bool>(json, r'allowUpload'),
 | 
			
		||||
        allowDownload: mapValueOfType<bool>(json, r'allowDownload'),
 | 
			
		||||
        showExif: mapValueOfType<bool>(json, r'showExif'),
 | 
			
		||||
        description: mapValueOfType<String>(json, r'description'),
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user