mirror of
https://github.com/immich-app/immich.git
synced 2025-12-06 09:13:13 +03:00
feat: make memories slideshow duration configurable (#22783)
This commit is contained in:
10
mobile/openapi/lib/model/memories_response.dart
generated
10
mobile/openapi/lib/model/memories_response.dart
generated
@@ -13,25 +13,31 @@ part of openapi.api;
|
||||
class MemoriesResponse {
|
||||
/// Returns a new [MemoriesResponse] instance.
|
||||
MemoriesResponse({
|
||||
this.duration = 5,
|
||||
this.enabled = true,
|
||||
});
|
||||
|
||||
int duration;
|
||||
|
||||
bool enabled;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MemoriesResponse &&
|
||||
other.duration == duration &&
|
||||
other.enabled == enabled;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(duration.hashCode) +
|
||||
(enabled.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MemoriesResponse[enabled=$enabled]';
|
||||
String toString() => 'MemoriesResponse[duration=$duration, enabled=$enabled]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'duration'] = this.duration;
|
||||
json[r'enabled'] = this.enabled;
|
||||
return json;
|
||||
}
|
||||
@@ -45,6 +51,7 @@ class MemoriesResponse {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MemoriesResponse(
|
||||
duration: mapValueOfType<int>(json, r'duration')!,
|
||||
enabled: mapValueOfType<bool>(json, r'enabled')!,
|
||||
);
|
||||
}
|
||||
@@ -93,6 +100,7 @@ class MemoriesResponse {
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'duration',
|
||||
'enabled',
|
||||
};
|
||||
}
|
||||
|
||||
20
mobile/openapi/lib/model/memories_update.dart
generated
20
mobile/openapi/lib/model/memories_update.dart
generated
@@ -13,9 +13,19 @@ part of openapi.api;
|
||||
class MemoriesUpdate {
|
||||
/// Returns a new [MemoriesUpdate] instance.
|
||||
MemoriesUpdate({
|
||||
this.duration,
|
||||
this.enabled,
|
||||
});
|
||||
|
||||
/// Minimum value: 1
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
int? duration;
|
||||
|
||||
///
|
||||
/// 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
|
||||
@@ -26,18 +36,25 @@ class MemoriesUpdate {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MemoriesUpdate &&
|
||||
other.duration == duration &&
|
||||
other.enabled == enabled;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(duration == null ? 0 : duration!.hashCode) +
|
||||
(enabled == null ? 0 : enabled!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MemoriesUpdate[enabled=$enabled]';
|
||||
String toString() => 'MemoriesUpdate[duration=$duration, enabled=$enabled]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.duration != null) {
|
||||
json[r'duration'] = this.duration;
|
||||
} else {
|
||||
// json[r'duration'] = null;
|
||||
}
|
||||
if (this.enabled != null) {
|
||||
json[r'enabled'] = this.enabled;
|
||||
} else {
|
||||
@@ -55,6 +72,7 @@ class MemoriesUpdate {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MemoriesUpdate(
|
||||
duration: mapValueOfType<int>(json, r'duration'),
|
||||
enabled: mapValueOfType<bool>(json, r'enabled'),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user