mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(server): use date type for entities (#2602)
This commit is contained in:
@@ -128,8 +128,8 @@ class Album {
|
||||
final Album a = Album(
|
||||
remoteId: dto.id,
|
||||
name: dto.albumName,
|
||||
createdAt: DateTime.parse(dto.createdAt),
|
||||
modifiedAt: DateTime.parse(dto.updatedAt),
|
||||
createdAt: dto.createdAt,
|
||||
modifiedAt: dto.updatedAt,
|
||||
shared: dto.shared,
|
||||
);
|
||||
a.owner.value = await db.users.getById(dto.ownerId);
|
||||
|
||||
@@ -22,9 +22,7 @@ class User {
|
||||
|
||||
User.fromDto(UserResponseDto dto)
|
||||
: id = dto.id,
|
||||
updatedAt = dto.updatedAt != null
|
||||
? DateTime.parse(dto.updatedAt!).toUtc()
|
||||
: DateTime.now().toUtc(),
|
||||
updatedAt = dto.updatedAt,
|
||||
email = dto.email,
|
||||
firstName = dto.firstName,
|
||||
lastName = dto.lastName,
|
||||
|
||||
@@ -279,7 +279,7 @@ class SyncService {
|
||||
|
||||
album.name = dto.albumName;
|
||||
album.shared = dto.shared;
|
||||
album.modifiedAt = DateTime.parse(dto.updatedAt);
|
||||
album.modifiedAt = dto.updatedAt;
|
||||
if (album.thumbnail.value?.remoteId != dto.albumThumbnailAssetId) {
|
||||
album.thumbnail.value = await _db.assets
|
||||
.where()
|
||||
@@ -713,5 +713,5 @@ bool _hasAlbumResponseDtoChanged(AlbumResponseDto dto, Album a) {
|
||||
dto.albumThumbnailAssetId != a.thumbnail.value?.remoteId ||
|
||||
dto.shared != a.shared ||
|
||||
dto.sharedUsers.length != a.sharedUsers.length ||
|
||||
!DateTime.parse(dto.updatedAt).isAtSameMomentAs(a.modifiedAt);
|
||||
!dto.updatedAt.isAtSameMomentAs(a.modifiedAt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user