feat(server/web): album description (#3558)

* feat(server): add album description

* chore: open api

* fix: tests

* show and edit description on the web

* fix test

* remove unused code

* type event

* format fix

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen 2023-08-05 22:43:26 -04:00 committed by GitHub
parent deaf81e2a4
commit 2f26a7edae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 287 additions and 41 deletions

View file

@ -18,6 +18,7 @@ class AlbumResponseDto {
required this.assetCount,
this.assets = const [],
required this.createdAt,
required this.description,
required this.id,
this.lastModifiedAssetTimestamp,
required this.owner,
@ -37,6 +38,8 @@ class AlbumResponseDto {
DateTime createdAt;
String description;
String id;
///
@ -64,6 +67,7 @@ class AlbumResponseDto {
other.assetCount == assetCount &&
other.assets == assets &&
other.createdAt == createdAt &&
other.description == description &&
other.id == id &&
other.lastModifiedAssetTimestamp == lastModifiedAssetTimestamp &&
other.owner == owner &&
@ -80,6 +84,7 @@ class AlbumResponseDto {
(assetCount.hashCode) +
(assets.hashCode) +
(createdAt.hashCode) +
(description.hashCode) +
(id.hashCode) +
(lastModifiedAssetTimestamp == null ? 0 : lastModifiedAssetTimestamp!.hashCode) +
(owner.hashCode) +
@ -89,7 +94,7 @@ class AlbumResponseDto {
(updatedAt.hashCode);
@override
String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, assetCount=$assetCount, assets=$assets, createdAt=$createdAt, id=$id, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, owner=$owner, ownerId=$ownerId, shared=$shared, sharedUsers=$sharedUsers, updatedAt=$updatedAt]';
String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, assetCount=$assetCount, assets=$assets, createdAt=$createdAt, description=$description, id=$id, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, owner=$owner, ownerId=$ownerId, shared=$shared, sharedUsers=$sharedUsers, updatedAt=$updatedAt]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -102,6 +107,7 @@ class AlbumResponseDto {
json[r'assetCount'] = this.assetCount;
json[r'assets'] = this.assets;
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
json[r'description'] = this.description;
json[r'id'] = this.id;
if (this.lastModifiedAssetTimestamp != null) {
json[r'lastModifiedAssetTimestamp'] = this.lastModifiedAssetTimestamp!.toUtc().toIso8601String();
@ -129,6 +135,7 @@ class AlbumResponseDto {
assetCount: mapValueOfType<int>(json, r'assetCount')!,
assets: AssetResponseDto.listFromJson(json[r'assets']),
createdAt: mapDateTime(json, r'createdAt', r'')!,
description: mapValueOfType<String>(json, r'description')!,
id: mapValueOfType<String>(json, r'id')!,
lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''),
owner: UserResponseDto.fromJson(json[r'owner'])!,
@ -188,6 +195,7 @@ class AlbumResponseDto {
'assetCount',
'assets',
'createdAt',
'description',
'id',
'owner',
'ownerId',