mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
chore(server) Add user FK to album entity (#1569)
This commit is contained in:
1
mobile/openapi/doc/AlbumResponseDto.md
generated
1
mobile/openapi/doc/AlbumResponseDto.md
generated
@@ -18,6 +18,7 @@ Name | Type | Description | Notes
|
||||
**shared** | **bool** | |
|
||||
**sharedUsers** | [**List<UserResponseDto>**](UserResponseDto.md) | | [default to const []]
|
||||
**assets** | [**List<AssetResponseDto>**](AssetResponseDto.md) | | [default to const []]
|
||||
**owner** | [**UserResponseDto**](UserResponseDto.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)
|
||||
|
||||
|
||||
2
mobile/openapi/doc/AssetResponseDto.md
generated
2
mobile/openapi/doc/AssetResponseDto.md
generated
@@ -26,7 +26,7 @@ Name | Type | Description | Notes
|
||||
**exifInfo** | [**ExifResponseDto**](ExifResponseDto.md) | | [optional]
|
||||
**smartInfo** | [**SmartInfoResponseDto**](SmartInfoResponseDto.md) | | [optional]
|
||||
**livePhotoVideoId** | **String** | | [optional]
|
||||
**tags** | [**List<TagResponseDto>**](TagResponseDto.md) | | [default to const []]
|
||||
**tags** | [**List<TagResponseDto>**](TagResponseDto.md) | | [optional] [default to const []]
|
||||
|
||||
[[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
@@ -23,6 +23,7 @@ class AlbumResponseDto {
|
||||
required this.shared,
|
||||
this.sharedUsers = const [],
|
||||
this.assets = const [],
|
||||
this.owner,
|
||||
});
|
||||
|
||||
int assetCount;
|
||||
@@ -45,6 +46,14 @@ class AlbumResponseDto {
|
||||
|
||||
List<AssetResponseDto> assets;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
UserResponseDto? owner;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AlbumResponseDto &&
|
||||
other.assetCount == assetCount &&
|
||||
@@ -56,7 +65,8 @@ class AlbumResponseDto {
|
||||
other.albumThumbnailAssetId == albumThumbnailAssetId &&
|
||||
other.shared == shared &&
|
||||
other.sharedUsers == sharedUsers &&
|
||||
other.assets == assets;
|
||||
other.assets == assets &&
|
||||
other.owner == owner;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
@@ -70,10 +80,11 @@ class AlbumResponseDto {
|
||||
(albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) +
|
||||
(shared.hashCode) +
|
||||
(sharedUsers.hashCode) +
|
||||
(assets.hashCode);
|
||||
(assets.hashCode) +
|
||||
(owner == null ? 0 : owner!.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]';
|
||||
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]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -91,6 +102,11 @@ class AlbumResponseDto {
|
||||
json[r'shared'] = this.shared;
|
||||
json[r'sharedUsers'] = this.sharedUsers;
|
||||
json[r'assets'] = this.assets;
|
||||
if (this.owner != null) {
|
||||
json[r'owner'] = this.owner;
|
||||
} else {
|
||||
// json[r'owner'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -123,6 +139,7 @@ class AlbumResponseDto {
|
||||
shared: mapValueOfType<bool>(json, r'shared')!,
|
||||
sharedUsers: UserResponseDto.listFromJson(json[r'sharedUsers'])!,
|
||||
assets: AssetResponseDto.listFromJson(json[r'assets'])!,
|
||||
owner: UserResponseDto.fromJson(json[r'owner']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
3
mobile/openapi/lib/model/asset_response_dto.dart
generated
3
mobile/openapi/lib/model/asset_response_dto.dart
generated
@@ -221,7 +221,7 @@ class AssetResponseDto {
|
||||
exifInfo: ExifResponseDto.fromJson(json[r'exifInfo']),
|
||||
smartInfo: SmartInfoResponseDto.fromJson(json[r'smartInfo']),
|
||||
livePhotoVideoId: mapValueOfType<String>(json, r'livePhotoVideoId'),
|
||||
tags: TagResponseDto.listFromJson(json[r'tags'])!,
|
||||
tags: TagResponseDto.listFromJson(json[r'tags']) ?? const [],
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -285,7 +285,6 @@ class AssetResponseDto {
|
||||
'mimeType',
|
||||
'duration',
|
||||
'webpPath',
|
||||
'tags',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
5
mobile/openapi/test/album_response_dto_test.dart
generated
5
mobile/openapi/test/album_response_dto_test.dart
generated
@@ -66,6 +66,11 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// UserResponseDto owner
|
||||
test('to test the property `owner`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user