You've already forked immich
							
							
				mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-31 00:18:28 +02:00 
			
		
		
		
	feat(web): Add album sorting to albums view (#2861)
* Add album sorting to web albums view * generate api --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
		
							
								
								
									
										1
									
								
								mobile/openapi/doc/AlbumResponseDto.md
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1
									
								
								mobile/openapi/doc/AlbumResponseDto.md
									
									
									
										generated
									
									
									
								
							| @@ -19,6 +19,7 @@ Name | Type | Description | Notes | ||||
| **sharedUsers** | [**List<UserResponseDto>**](UserResponseDto.md) |  | [default to const []] | ||||
| **assets** | [**List<AssetResponseDto>**](AssetResponseDto.md) |  | [default to const []] | ||||
| **owner** | [**UserResponseDto**](UserResponseDto.md) |  |  | ||||
| **lastModifiedAssetTimestamp** | [**DateTime**](DateTime.md) |  | [optional]  | ||||
| 
 | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
| 
 | ||||
|   | ||||
							
								
								
									
										23
									
								
								mobile/openapi/lib/model/album_response_dto.dart
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										23
									
								
								mobile/openapi/lib/model/album_response_dto.dart
									
									
									
										generated
									
									
									
								
							| @@ -24,6 +24,7 @@ class AlbumResponseDto { | ||||
|     this.sharedUsers = const [], | ||||
|     this.assets = const [], | ||||
|     required this.owner, | ||||
|     this.lastModifiedAssetTimestamp, | ||||
|   }); | ||||
| 
 | ||||
|   int assetCount; | ||||
| @@ -48,6 +49,14 @@ class AlbumResponseDto { | ||||
| 
 | ||||
|   UserResponseDto owner; | ||||
| 
 | ||||
|   /// | ||||
|   /// 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. | ||||
|   /// | ||||
|   DateTime? lastModifiedAssetTimestamp; | ||||
| 
 | ||||
|   @override | ||||
|   bool operator ==(Object other) => identical(this, other) || other is AlbumResponseDto && | ||||
|      other.assetCount == assetCount && | ||||
| @@ -60,7 +69,8 @@ class AlbumResponseDto { | ||||
|      other.shared == shared && | ||||
|      other.sharedUsers == sharedUsers && | ||||
|      other.assets == assets && | ||||
|      other.owner == owner; | ||||
|      other.owner == owner && | ||||
|      other.lastModifiedAssetTimestamp == lastModifiedAssetTimestamp; | ||||
| 
 | ||||
|   @override | ||||
|   int get hashCode => | ||||
| @@ -75,10 +85,11 @@ class AlbumResponseDto { | ||||
|     (shared.hashCode) + | ||||
|     (sharedUsers.hashCode) + | ||||
|     (assets.hashCode) + | ||||
|     (owner.hashCode); | ||||
|     (owner.hashCode) + | ||||
|     (lastModifiedAssetTimestamp == null ? 0 : lastModifiedAssetTimestamp!.hashCode); | ||||
| 
 | ||||
|   @override | ||||
|   String toString() => 'AlbumResponseDto[assetCount=$assetCount, id=$id, ownerId=$ownerId, albumName=$albumName, createdAt=$createdAt, updatedAt=$updatedAt, albumThumbnailAssetId=$albumThumbnailAssetId, shared=$shared, sharedUsers=$sharedUsers, assets=$assets, owner=$owner]'; | ||||
|   String toString() => 'AlbumResponseDto[assetCount=$assetCount, id=$id, ownerId=$ownerId, albumName=$albumName, createdAt=$createdAt, updatedAt=$updatedAt, albumThumbnailAssetId=$albumThumbnailAssetId, shared=$shared, sharedUsers=$sharedUsers, assets=$assets, owner=$owner, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp]'; | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     final json = <String, dynamic>{}; | ||||
| @@ -97,6 +108,11 @@ class AlbumResponseDto { | ||||
|       json[r'sharedUsers'] = this.sharedUsers; | ||||
|       json[r'assets'] = this.assets; | ||||
|       json[r'owner'] = this.owner; | ||||
|     if (this.lastModifiedAssetTimestamp != null) { | ||||
|       json[r'lastModifiedAssetTimestamp'] = this.lastModifiedAssetTimestamp!.toUtc().toIso8601String(); | ||||
|     } else { | ||||
|       // json[r'lastModifiedAssetTimestamp'] = null; | ||||
|     } | ||||
|     return json; | ||||
|   } | ||||
| 
 | ||||
| @@ -130,6 +146,7 @@ class AlbumResponseDto { | ||||
|         sharedUsers: UserResponseDto.listFromJson(json[r'sharedUsers']), | ||||
|         assets: AssetResponseDto.listFromJson(json[r'assets']), | ||||
|         owner: UserResponseDto.fromJson(json[r'owner'])!, | ||||
|         lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', ''), | ||||
|       ); | ||||
|     } | ||||
|     return null; | ||||
|   | ||||
							
								
								
									
										5
									
								
								mobile/openapi/test/album_response_dto_test.dart
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										5
									
								
								mobile/openapi/test/album_response_dto_test.dart
									
									
									
										generated
									
									
									
								
							| @@ -71,6 +71,11 @@ void main() { | ||||
|       // TODO | ||||
|     }); | ||||
| 
 | ||||
|     // DateTime lastModifiedAssetTimestamp | ||||
|     test('to test the property `lastModifiedAssetTimestamp`', () async { | ||||
|       // TODO | ||||
|     }); | ||||
| 
 | ||||
| 
 | ||||
|   }); | ||||
| 
 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user