mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(server, web): album orders (#7819)
* feat: album orders * fix: tests * pr feedback * pr feedback * pr feedback * fix: tests * add comment * pr feedback * fix: rendering issue * wording * fix: order value doesn't change --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
parent
1c4637cb43
commit
31f7e1aca3
32 changed files with 251 additions and 49 deletions
19
mobile/openapi/lib/model/album_response_dto.dart
generated
19
mobile/openapi/lib/model/album_response_dto.dart
generated
|
|
@ -24,6 +24,7 @@ class AlbumResponseDto {
|
|||
required this.id,
|
||||
required this.isActivityEnabled,
|
||||
this.lastModifiedAssetTimestamp,
|
||||
this.order,
|
||||
required this.owner,
|
||||
required this.ownerId,
|
||||
required this.shared,
|
||||
|
|
@ -66,6 +67,14 @@ class AlbumResponseDto {
|
|||
///
|
||||
DateTime? lastModifiedAssetTimestamp;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
AssetOrder? order;
|
||||
|
||||
UserResponseDto owner;
|
||||
|
||||
String ownerId;
|
||||
|
|
@ -97,6 +106,7 @@ class AlbumResponseDto {
|
|||
other.id == id &&
|
||||
other.isActivityEnabled == isActivityEnabled &&
|
||||
other.lastModifiedAssetTimestamp == lastModifiedAssetTimestamp &&
|
||||
other.order == order &&
|
||||
other.owner == owner &&
|
||||
other.ownerId == ownerId &&
|
||||
other.shared == shared &&
|
||||
|
|
@ -118,6 +128,7 @@ class AlbumResponseDto {
|
|||
(id.hashCode) +
|
||||
(isActivityEnabled.hashCode) +
|
||||
(lastModifiedAssetTimestamp == null ? 0 : lastModifiedAssetTimestamp!.hashCode) +
|
||||
(order == null ? 0 : order!.hashCode) +
|
||||
(owner.hashCode) +
|
||||
(ownerId.hashCode) +
|
||||
(shared.hashCode) +
|
||||
|
|
@ -126,7 +137,7 @@ class AlbumResponseDto {
|
|||
(updatedAt.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, assetCount=$assetCount, assets=$assets, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, owner=$owner, ownerId=$ownerId, shared=$shared, sharedUsers=$sharedUsers, startDate=$startDate, updatedAt=$updatedAt]';
|
||||
String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, assetCount=$assetCount, assets=$assets, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, order=$order, owner=$owner, ownerId=$ownerId, shared=$shared, sharedUsers=$sharedUsers, startDate=$startDate, updatedAt=$updatedAt]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
|
|
@ -152,6 +163,11 @@ class AlbumResponseDto {
|
|||
json[r'lastModifiedAssetTimestamp'] = this.lastModifiedAssetTimestamp!.toUtc().toIso8601String();
|
||||
} else {
|
||||
// json[r'lastModifiedAssetTimestamp'] = null;
|
||||
}
|
||||
if (this.order != null) {
|
||||
json[r'order'] = this.order;
|
||||
} else {
|
||||
// json[r'order'] = null;
|
||||
}
|
||||
json[r'owner'] = this.owner;
|
||||
json[r'ownerId'] = this.ownerId;
|
||||
|
|
@ -185,6 +201,7 @@ class AlbumResponseDto {
|
|||
id: mapValueOfType<String>(json, r'id')!,
|
||||
isActivityEnabled: mapValueOfType<bool>(json, r'isActivityEnabled')!,
|
||||
lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''),
|
||||
order: AssetOrder.fromJson(json[r'order']),
|
||||
owner: UserResponseDto.fromJson(json[r'owner'])!,
|
||||
ownerId: mapValueOfType<String>(json, r'ownerId')!,
|
||||
shared: mapValueOfType<bool>(json, r'shared')!,
|
||||
|
|
|
|||
23
mobile/openapi/lib/model/update_album_dto.dart
generated
23
mobile/openapi/lib/model/update_album_dto.dart
generated
|
|
@ -17,6 +17,7 @@ class UpdateAlbumDto {
|
|||
this.albumThumbnailAssetId,
|
||||
this.description,
|
||||
this.isActivityEnabled,
|
||||
this.order,
|
||||
});
|
||||
|
||||
///
|
||||
|
|
@ -51,12 +52,21 @@ class UpdateAlbumDto {
|
|||
///
|
||||
bool? isActivityEnabled;
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
AssetOrder? order;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UpdateAlbumDto &&
|
||||
other.albumName == albumName &&
|
||||
other.albumThumbnailAssetId == albumThumbnailAssetId &&
|
||||
other.description == description &&
|
||||
other.isActivityEnabled == isActivityEnabled;
|
||||
other.isActivityEnabled == isActivityEnabled &&
|
||||
other.order == order;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
|
|
@ -64,10 +74,11 @@ class UpdateAlbumDto {
|
|||
(albumName == null ? 0 : albumName!.hashCode) +
|
||||
(albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) +
|
||||
(description == null ? 0 : description!.hashCode) +
|
||||
(isActivityEnabled == null ? 0 : isActivityEnabled!.hashCode);
|
||||
(isActivityEnabled == null ? 0 : isActivityEnabled!.hashCode) +
|
||||
(order == null ? 0 : order!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UpdateAlbumDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, description=$description, isActivityEnabled=$isActivityEnabled]';
|
||||
String toString() => 'UpdateAlbumDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, description=$description, isActivityEnabled=$isActivityEnabled, order=$order]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
|
|
@ -91,6 +102,11 @@ class UpdateAlbumDto {
|
|||
} else {
|
||||
// json[r'isActivityEnabled'] = null;
|
||||
}
|
||||
if (this.order != null) {
|
||||
json[r'order'] = this.order;
|
||||
} else {
|
||||
// json[r'order'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
|
@ -106,6 +122,7 @@ class UpdateAlbumDto {
|
|||
albumThumbnailAssetId: mapValueOfType<String>(json, r'albumThumbnailAssetId'),
|
||||
description: mapValueOfType<String>(json, r'description'),
|
||||
isActivityEnabled: mapValueOfType<bool>(json, r'isActivityEnabled'),
|
||||
order: AssetOrder.fromJson(json[r'order']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue