mirror of
https://github.com/immich-app/immich.git
synced 2026-02-11 11:27:56 +03:00
feat: unassign faces
This commit is contained in:
20
mobile/openapi/lib/model/asset_response_dto.dart
generated
20
mobile/openapi/lib/model/asset_response_dto.dart
generated
@@ -35,7 +35,7 @@ class AssetResponseDto {
|
||||
required this.originalPath,
|
||||
this.owner,
|
||||
required this.ownerId,
|
||||
this.people = const [],
|
||||
this.people,
|
||||
required this.resized,
|
||||
this.smartInfo,
|
||||
this.stack = const [],
|
||||
@@ -118,7 +118,13 @@ class AssetResponseDto {
|
||||
|
||||
String ownerId;
|
||||
|
||||
List<PersonWithFacesResponseDto> people;
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
PeopleWithFacesResponseDto? people;
|
||||
|
||||
bool resized;
|
||||
|
||||
@@ -168,7 +174,7 @@ class AssetResponseDto {
|
||||
other.originalPath == originalPath &&
|
||||
other.owner == owner &&
|
||||
other.ownerId == ownerId &&
|
||||
_deepEquality.equals(other.people, people) &&
|
||||
other.people == people &&
|
||||
other.resized == resized &&
|
||||
other.smartInfo == smartInfo &&
|
||||
_deepEquality.equals(other.stack, stack) &&
|
||||
@@ -204,7 +210,7 @@ class AssetResponseDto {
|
||||
(originalPath.hashCode) +
|
||||
(owner == null ? 0 : owner!.hashCode) +
|
||||
(ownerId.hashCode) +
|
||||
(people.hashCode) +
|
||||
(people == null ? 0 : people!.hashCode) +
|
||||
(resized.hashCode) +
|
||||
(smartInfo == null ? 0 : smartInfo!.hashCode) +
|
||||
(stack.hashCode) +
|
||||
@@ -262,7 +268,11 @@ class AssetResponseDto {
|
||||
// json[r'owner'] = null;
|
||||
}
|
||||
json[r'ownerId'] = this.ownerId;
|
||||
if (this.people != null) {
|
||||
json[r'people'] = this.people;
|
||||
} else {
|
||||
// json[r'people'] = null;
|
||||
}
|
||||
json[r'resized'] = this.resized;
|
||||
if (this.smartInfo != null) {
|
||||
json[r'smartInfo'] = this.smartInfo;
|
||||
@@ -321,7 +331,7 @@ class AssetResponseDto {
|
||||
originalPath: mapValueOfType<String>(json, r'originalPath')!,
|
||||
owner: UserResponseDto.fromJson(json[r'owner']),
|
||||
ownerId: mapValueOfType<String>(json, r'ownerId')!,
|
||||
people: PersonWithFacesResponseDto.listFromJson(json[r'people']),
|
||||
people: PeopleWithFacesResponseDto.fromJson(json[r'people']),
|
||||
resized: mapValueOfType<bool>(json, r'resized')!,
|
||||
smartInfo: SmartInfoResponseDto.fromJson(json[r'smartInfo']),
|
||||
stack: AssetResponseDto.listFromJson(json[r'stack']),
|
||||
|
||||
106
mobile/openapi/lib/model/people_with_faces_response_dto.dart
generated
Normal file
106
mobile/openapi/lib/model/people_with_faces_response_dto.dart
generated
Normal file
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: constant_identifier_names
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class PeopleWithFacesResponseDto {
|
||||
/// Returns a new [PeopleWithFacesResponseDto] instance.
|
||||
PeopleWithFacesResponseDto({
|
||||
this.faces = const [],
|
||||
required this.numberOfFaces,
|
||||
});
|
||||
|
||||
List<PersonWithFacesResponseDto> faces;
|
||||
|
||||
int numberOfFaces;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PeopleWithFacesResponseDto &&
|
||||
_deepEquality.equals(other.faces, faces) &&
|
||||
other.numberOfFaces == numberOfFaces;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(faces.hashCode) +
|
||||
(numberOfFaces.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'PeopleWithFacesResponseDto[faces=$faces, numberOfFaces=$numberOfFaces]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'faces'] = this.faces;
|
||||
json[r'numberOfFaces'] = this.numberOfFaces;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [PeopleWithFacesResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static PeopleWithFacesResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return PeopleWithFacesResponseDto(
|
||||
faces: PersonWithFacesResponseDto.listFromJson(json[r'faces']),
|
||||
numberOfFaces: mapValueOfType<int>(json, r'numberOfFaces')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<PeopleWithFacesResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <PeopleWithFacesResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = PeopleWithFacesResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, PeopleWithFacesResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, PeopleWithFacesResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = PeopleWithFacesResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of PeopleWithFacesResponseDto-objects as value to a dart map
|
||||
static Map<String, List<PeopleWithFacesResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<PeopleWithFacesResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = PeopleWithFacesResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'faces',
|
||||
'numberOfFaces',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user