mirror of
https://github.com/immich-app/immich.git
synced 2025-12-28 17:24:56 +03:00
fix: memory lane assets in ascending order (#8309)
* fix: memory lane asset order * chore: deprecate title * chore: open-api * chore: rename years => yearsAgo
This commit is contained in:
1
mobile/openapi/doc/MemoryLaneResponseDto.md
generated
1
mobile/openapi/doc/MemoryLaneResponseDto.md
generated
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**assets** | [**List<AssetResponseDto>**](AssetResponseDto.md) | | [default to const []]
|
||||
**title** | **String** | |
|
||||
**yearsAgo** | **num** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -15,30 +15,36 @@ class MemoryLaneResponseDto {
|
||||
MemoryLaneResponseDto({
|
||||
this.assets = const [],
|
||||
required this.title,
|
||||
required this.yearsAgo,
|
||||
});
|
||||
|
||||
List<AssetResponseDto> assets;
|
||||
|
||||
String title;
|
||||
|
||||
num yearsAgo;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MemoryLaneResponseDto &&
|
||||
_deepEquality.equals(other.assets, assets) &&
|
||||
other.title == title;
|
||||
other.title == title &&
|
||||
other.yearsAgo == yearsAgo;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(assets.hashCode) +
|
||||
(title.hashCode);
|
||||
(title.hashCode) +
|
||||
(yearsAgo.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MemoryLaneResponseDto[assets=$assets, title=$title]';
|
||||
String toString() => 'MemoryLaneResponseDto[assets=$assets, title=$title, yearsAgo=$yearsAgo]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'assets'] = this.assets;
|
||||
json[r'title'] = this.title;
|
||||
json[r'yearsAgo'] = this.yearsAgo;
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -52,6 +58,7 @@ class MemoryLaneResponseDto {
|
||||
return MemoryLaneResponseDto(
|
||||
assets: AssetResponseDto.listFromJson(json[r'assets']),
|
||||
title: mapValueOfType<String>(json, r'title')!,
|
||||
yearsAgo: num.parse('${json[r'yearsAgo']}'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -101,6 +108,7 @@ class MemoryLaneResponseDto {
|
||||
static const requiredKeys = <String>{
|
||||
'assets',
|
||||
'title',
|
||||
'yearsAgo',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,11 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// num yearsAgo
|
||||
test('to test the property `yearsAgo`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user