1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

fix: regression: sort day by fileCreatedAt again (#18732)

* fix: regression: sort day by fileCreatedAt again

* lint

* e2e test

* inline function

* e2e

* Address comments. Drop dayGroup and timezone in favor of localOffsetMinutes

* lint and some api-doc

* lint, more api-doc

* format

* Move minutes to fractional hours

* make sql

* merge/conflict

* merge fallout, review comments

* spelling

* drop offset from returned date

* move description into decorator where possible, regen api
This commit is contained in:
Min Idzelis
2025-06-05 21:56:32 -04:00
committed by GitHub
parent 81423420c8
commit 55f4e93456
23 changed files with 687 additions and 247 deletions

View File

@ -16,12 +16,13 @@ class TimeBucketAssetResponseDto {
this.city = const [],
this.country = const [],
this.duration = const [],
this.fileCreatedAt = const [],
this.id = const [],
this.isFavorite = const [],
this.isImage = const [],
this.isTrashed = const [],
this.livePhotoVideoId = const [],
this.localDateTime = const [],
this.localOffsetHours = const [],
this.ownerId = const [],
this.projectionType = const [],
this.ratio = const [],
@ -30,35 +31,52 @@ class TimeBucketAssetResponseDto {
this.visibility = const [],
});
/// Array of city names extracted from EXIF GPS data
List<String?> city;
/// Array of country names extracted from EXIF GPS data
List<String?> country;
/// Array of video durations in HH:MM:SS format (null for images)
List<String?> duration;
/// Array of file creation timestamps in UTC (ISO 8601 format, without timezone)
List<String> fileCreatedAt;
/// Array of asset IDs in the time bucket
List<String> id;
/// Array indicating whether each asset is favorited
List<bool> isFavorite;
/// Array indicating whether each asset is an image (false for videos)
List<bool> isImage;
/// Array indicating whether each asset is in the trash
List<bool> isTrashed;
/// Array of live photo video asset IDs (null for non-live photos)
List<String?> livePhotoVideoId;
List<String> localDateTime;
/// Array of UTC offset hours at the time each photo was taken. Positive values are east of UTC, negative values are west of UTC. Values may be fractional (e.g., 5.5 for +05:30, -9.75 for -09:45). Applying this offset to 'fileCreatedAt' will give you the time the photo was taken from the photographer's perspective.
List<num> localOffsetHours;
/// Array of owner IDs for each asset
List<String> ownerId;
/// Array of projection types for 360° content (e.g., \"EQUIRECTANGULAR\", \"CUBEFACE\", \"CYLINDRICAL\")
List<String?> projectionType;
/// Array of aspect ratios (width/height) for each asset
List<num> ratio;
/// (stack ID, stack asset count) tuple
/// Array of stack information as [stackId, assetCount] tuples (null for non-stacked assets)
List<List<String>?> stack;
/// Array of BlurHash strings for generating asset previews (base64 encoded)
List<String?> thumbhash;
/// Array of visibility statuses for each asset (e.g., ARCHIVE, TIMELINE, HIDDEN, LOCKED)
List<AssetVisibility> visibility;
@override
@ -66,12 +84,13 @@ class TimeBucketAssetResponseDto {
_deepEquality.equals(other.city, city) &&
_deepEquality.equals(other.country, country) &&
_deepEquality.equals(other.duration, duration) &&
_deepEquality.equals(other.fileCreatedAt, fileCreatedAt) &&
_deepEquality.equals(other.id, id) &&
_deepEquality.equals(other.isFavorite, isFavorite) &&
_deepEquality.equals(other.isImage, isImage) &&
_deepEquality.equals(other.isTrashed, isTrashed) &&
_deepEquality.equals(other.livePhotoVideoId, livePhotoVideoId) &&
_deepEquality.equals(other.localDateTime, localDateTime) &&
_deepEquality.equals(other.localOffsetHours, localOffsetHours) &&
_deepEquality.equals(other.ownerId, ownerId) &&
_deepEquality.equals(other.projectionType, projectionType) &&
_deepEquality.equals(other.ratio, ratio) &&
@ -85,12 +104,13 @@ class TimeBucketAssetResponseDto {
(city.hashCode) +
(country.hashCode) +
(duration.hashCode) +
(fileCreatedAt.hashCode) +
(id.hashCode) +
(isFavorite.hashCode) +
(isImage.hashCode) +
(isTrashed.hashCode) +
(livePhotoVideoId.hashCode) +
(localDateTime.hashCode) +
(localOffsetHours.hashCode) +
(ownerId.hashCode) +
(projectionType.hashCode) +
(ratio.hashCode) +
@ -99,19 +119,20 @@ class TimeBucketAssetResponseDto {
(visibility.hashCode);
@override
String toString() => 'TimeBucketAssetResponseDto[city=$city, country=$country, duration=$duration, id=$id, isFavorite=$isFavorite, isImage=$isImage, isTrashed=$isTrashed, livePhotoVideoId=$livePhotoVideoId, localDateTime=$localDateTime, ownerId=$ownerId, projectionType=$projectionType, ratio=$ratio, stack=$stack, thumbhash=$thumbhash, visibility=$visibility]';
String toString() => 'TimeBucketAssetResponseDto[city=$city, country=$country, duration=$duration, fileCreatedAt=$fileCreatedAt, id=$id, isFavorite=$isFavorite, isImage=$isImage, isTrashed=$isTrashed, livePhotoVideoId=$livePhotoVideoId, localOffsetHours=$localOffsetHours, ownerId=$ownerId, projectionType=$projectionType, ratio=$ratio, stack=$stack, thumbhash=$thumbhash, visibility=$visibility]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'city'] = this.city;
json[r'country'] = this.country;
json[r'duration'] = this.duration;
json[r'fileCreatedAt'] = this.fileCreatedAt;
json[r'id'] = this.id;
json[r'isFavorite'] = this.isFavorite;
json[r'isImage'] = this.isImage;
json[r'isTrashed'] = this.isTrashed;
json[r'livePhotoVideoId'] = this.livePhotoVideoId;
json[r'localDateTime'] = this.localDateTime;
json[r'localOffsetHours'] = this.localOffsetHours;
json[r'ownerId'] = this.ownerId;
json[r'projectionType'] = this.projectionType;
json[r'ratio'] = this.ratio;
@ -139,6 +160,9 @@ class TimeBucketAssetResponseDto {
duration: json[r'duration'] is Iterable
? (json[r'duration'] as Iterable).cast<String>().toList(growable: false)
: const [],
fileCreatedAt: json[r'fileCreatedAt'] is Iterable
? (json[r'fileCreatedAt'] as Iterable).cast<String>().toList(growable: false)
: const [],
id: json[r'id'] is Iterable
? (json[r'id'] as Iterable).cast<String>().toList(growable: false)
: const [],
@ -154,8 +178,8 @@ class TimeBucketAssetResponseDto {
livePhotoVideoId: json[r'livePhotoVideoId'] is Iterable
? (json[r'livePhotoVideoId'] as Iterable).cast<String>().toList(growable: false)
: const [],
localDateTime: json[r'localDateTime'] is Iterable
? (json[r'localDateTime'] as Iterable).cast<String>().toList(growable: false)
localOffsetHours: json[r'localOffsetHours'] is Iterable
? (json[r'localOffsetHours'] as Iterable).cast<num>().toList(growable: false)
: const [],
ownerId: json[r'ownerId'] is Iterable
? (json[r'ownerId'] as Iterable).cast<String>().toList(growable: false)
@ -225,12 +249,13 @@ class TimeBucketAssetResponseDto {
'city',
'country',
'duration',
'fileCreatedAt',
'id',
'isFavorite',
'isImage',
'isTrashed',
'livePhotoVideoId',
'localDateTime',
'localOffsetHours',
'ownerId',
'projectionType',
'ratio',