mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(web,server)!: configure machine learning via the UI (#3768)
This commit is contained in:
2
mobile/openapi/lib/api.dart
generated
2
mobile/openapi/lib/api.dart
generated
@@ -115,7 +115,6 @@ part 'model/queue_status_dto.dart';
|
||||
part 'model/search_album_response_dto.dart';
|
||||
part 'model/search_asset_dto.dart';
|
||||
part 'model/search_asset_response_dto.dart';
|
||||
part 'model/search_config_response_dto.dart';
|
||||
part 'model/search_explore_item.dart';
|
||||
part 'model/search_explore_response_dto.dart';
|
||||
part 'model/search_facet_count_response_dto.dart';
|
||||
@@ -136,6 +135,7 @@ part 'model/smart_info_response_dto.dart';
|
||||
part 'model/system_config_dto.dart';
|
||||
part 'model/system_config_f_fmpeg_dto.dart';
|
||||
part 'model/system_config_job_dto.dart';
|
||||
part 'model/system_config_machine_learning_dto.dart';
|
||||
part 'model/system_config_o_auth_dto.dart';
|
||||
part 'model/system_config_password_login_dto.dart';
|
||||
part 'model/system_config_storage_template_dto.dart';
|
||||
|
||||
41
mobile/openapi/lib/api/search_api.dart
generated
41
mobile/openapi/lib/api/search_api.dart
generated
@@ -60,47 +60,6 @@ class SearchApi {
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /search/config' operation and returns the [Response].
|
||||
Future<Response> getSearchConfigWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/search/config';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<SearchConfigResponseDto?> getSearchConfig() async {
|
||||
final response = await getSearchConfigWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SearchConfigResponseDto',) as SearchConfigResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /search' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
|
||||
4
mobile/openapi/lib/api_client.dart
generated
4
mobile/openapi/lib/api_client.dart
generated
@@ -323,8 +323,6 @@ class ApiClient {
|
||||
return SearchAssetDto.fromJson(value);
|
||||
case 'SearchAssetResponseDto':
|
||||
return SearchAssetResponseDto.fromJson(value);
|
||||
case 'SearchConfigResponseDto':
|
||||
return SearchConfigResponseDto.fromJson(value);
|
||||
case 'SearchExploreItem':
|
||||
return SearchExploreItem.fromJson(value);
|
||||
case 'SearchExploreResponseDto':
|
||||
@@ -365,6 +363,8 @@ class ApiClient {
|
||||
return SystemConfigFFmpegDto.fromJson(value);
|
||||
case 'SystemConfigJobDto':
|
||||
return SystemConfigJobDto.fromJson(value);
|
||||
case 'SystemConfigMachineLearningDto':
|
||||
return SystemConfigMachineLearningDto.fromJson(value);
|
||||
case 'SystemConfigOAuthDto':
|
||||
return SystemConfigOAuthDto.fromJson(value);
|
||||
case 'SystemConfigPasswordLoginDto':
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
//
|
||||
// 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 SearchConfigResponseDto {
|
||||
/// Returns a new [SearchConfigResponseDto] instance.
|
||||
SearchConfigResponseDto({
|
||||
required this.enabled,
|
||||
});
|
||||
|
||||
bool enabled;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SearchConfigResponseDto &&
|
||||
other.enabled == enabled;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(enabled.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SearchConfigResponseDto[enabled=$enabled]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'enabled'] = this.enabled;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [SearchConfigResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static SearchConfigResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return SearchConfigResponseDto(
|
||||
enabled: mapValueOfType<bool>(json, r'enabled')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<SearchConfigResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <SearchConfigResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = SearchConfigResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, SearchConfigResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, SearchConfigResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SearchConfigResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of SearchConfigResponseDto-objects as value to a dart map
|
||||
static Map<String, List<SearchConfigResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<SearchConfigResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = SearchConfigResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'enabled',
|
||||
};
|
||||
}
|
||||
|
||||
44
mobile/openapi/lib/model/server_features_dto.dart
generated
44
mobile/openapi/lib/model/server_features_dto.dart
generated
@@ -13,14 +13,19 @@ part of openapi.api;
|
||||
class ServerFeaturesDto {
|
||||
/// Returns a new [ServerFeaturesDto] instance.
|
||||
ServerFeaturesDto({
|
||||
required this.machineLearning,
|
||||
required this.clipEncode,
|
||||
required this.facialRecognition,
|
||||
required this.oauth,
|
||||
required this.oauthAutoLaunch,
|
||||
required this.passwordLogin,
|
||||
required this.search,
|
||||
required this.sidecar,
|
||||
required this.tagImage,
|
||||
});
|
||||
|
||||
bool machineLearning;
|
||||
bool clipEncode;
|
||||
|
||||
bool facialRecognition;
|
||||
|
||||
bool oauth;
|
||||
|
||||
@@ -30,33 +35,46 @@ class ServerFeaturesDto {
|
||||
|
||||
bool search;
|
||||
|
||||
bool sidecar;
|
||||
|
||||
bool tagImage;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ServerFeaturesDto &&
|
||||
other.machineLearning == machineLearning &&
|
||||
other.clipEncode == clipEncode &&
|
||||
other.facialRecognition == facialRecognition &&
|
||||
other.oauth == oauth &&
|
||||
other.oauthAutoLaunch == oauthAutoLaunch &&
|
||||
other.passwordLogin == passwordLogin &&
|
||||
other.search == search;
|
||||
other.search == search &&
|
||||
other.sidecar == sidecar &&
|
||||
other.tagImage == tagImage;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(machineLearning.hashCode) +
|
||||
(clipEncode.hashCode) +
|
||||
(facialRecognition.hashCode) +
|
||||
(oauth.hashCode) +
|
||||
(oauthAutoLaunch.hashCode) +
|
||||
(passwordLogin.hashCode) +
|
||||
(search.hashCode);
|
||||
(search.hashCode) +
|
||||
(sidecar.hashCode) +
|
||||
(tagImage.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ServerFeaturesDto[machineLearning=$machineLearning, oauth=$oauth, oauthAutoLaunch=$oauthAutoLaunch, passwordLogin=$passwordLogin, search=$search]';
|
||||
String toString() => 'ServerFeaturesDto[clipEncode=$clipEncode, facialRecognition=$facialRecognition, oauth=$oauth, oauthAutoLaunch=$oauthAutoLaunch, passwordLogin=$passwordLogin, search=$search, sidecar=$sidecar, tagImage=$tagImage]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'machineLearning'] = this.machineLearning;
|
||||
json[r'clipEncode'] = this.clipEncode;
|
||||
json[r'facialRecognition'] = this.facialRecognition;
|
||||
json[r'oauth'] = this.oauth;
|
||||
json[r'oauthAutoLaunch'] = this.oauthAutoLaunch;
|
||||
json[r'passwordLogin'] = this.passwordLogin;
|
||||
json[r'search'] = this.search;
|
||||
json[r'sidecar'] = this.sidecar;
|
||||
json[r'tagImage'] = this.tagImage;
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -68,11 +86,14 @@ class ServerFeaturesDto {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return ServerFeaturesDto(
|
||||
machineLearning: mapValueOfType<bool>(json, r'machineLearning')!,
|
||||
clipEncode: mapValueOfType<bool>(json, r'clipEncode')!,
|
||||
facialRecognition: mapValueOfType<bool>(json, r'facialRecognition')!,
|
||||
oauth: mapValueOfType<bool>(json, r'oauth')!,
|
||||
oauthAutoLaunch: mapValueOfType<bool>(json, r'oauthAutoLaunch')!,
|
||||
passwordLogin: mapValueOfType<bool>(json, r'passwordLogin')!,
|
||||
search: mapValueOfType<bool>(json, r'search')!,
|
||||
sidecar: mapValueOfType<bool>(json, r'sidecar')!,
|
||||
tagImage: mapValueOfType<bool>(json, r'tagImage')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -120,11 +141,14 @@ class ServerFeaturesDto {
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'machineLearning',
|
||||
'clipEncode',
|
||||
'facialRecognition',
|
||||
'oauth',
|
||||
'oauthAutoLaunch',
|
||||
'passwordLogin',
|
||||
'search',
|
||||
'sidecar',
|
||||
'tagImage',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
10
mobile/openapi/lib/model/system_config_dto.dart
generated
10
mobile/openapi/lib/model/system_config_dto.dart
generated
@@ -15,6 +15,7 @@ class SystemConfigDto {
|
||||
SystemConfigDto({
|
||||
required this.ffmpeg,
|
||||
required this.job,
|
||||
required this.machineLearning,
|
||||
required this.oauth,
|
||||
required this.passwordLogin,
|
||||
required this.storageTemplate,
|
||||
@@ -25,6 +26,8 @@ class SystemConfigDto {
|
||||
|
||||
SystemConfigJobDto job;
|
||||
|
||||
SystemConfigMachineLearningDto machineLearning;
|
||||
|
||||
SystemConfigOAuthDto oauth;
|
||||
|
||||
SystemConfigPasswordLoginDto passwordLogin;
|
||||
@@ -37,6 +40,7 @@ class SystemConfigDto {
|
||||
bool operator ==(Object other) => identical(this, other) || other is SystemConfigDto &&
|
||||
other.ffmpeg == ffmpeg &&
|
||||
other.job == job &&
|
||||
other.machineLearning == machineLearning &&
|
||||
other.oauth == oauth &&
|
||||
other.passwordLogin == passwordLogin &&
|
||||
other.storageTemplate == storageTemplate &&
|
||||
@@ -47,18 +51,20 @@ class SystemConfigDto {
|
||||
// ignore: unnecessary_parenthesis
|
||||
(ffmpeg.hashCode) +
|
||||
(job.hashCode) +
|
||||
(machineLearning.hashCode) +
|
||||
(oauth.hashCode) +
|
||||
(passwordLogin.hashCode) +
|
||||
(storageTemplate.hashCode) +
|
||||
(thumbnail.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, oauth=$oauth, passwordLogin=$passwordLogin, storageTemplate=$storageTemplate, thumbnail=$thumbnail]';
|
||||
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, machineLearning=$machineLearning, oauth=$oauth, passwordLogin=$passwordLogin, storageTemplate=$storageTemplate, thumbnail=$thumbnail]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'ffmpeg'] = this.ffmpeg;
|
||||
json[r'job'] = this.job;
|
||||
json[r'machineLearning'] = this.machineLearning;
|
||||
json[r'oauth'] = this.oauth;
|
||||
json[r'passwordLogin'] = this.passwordLogin;
|
||||
json[r'storageTemplate'] = this.storageTemplate;
|
||||
@@ -76,6 +82,7 @@ class SystemConfigDto {
|
||||
return SystemConfigDto(
|
||||
ffmpeg: SystemConfigFFmpegDto.fromJson(json[r'ffmpeg'])!,
|
||||
job: SystemConfigJobDto.fromJson(json[r'job'])!,
|
||||
machineLearning: SystemConfigMachineLearningDto.fromJson(json[r'machineLearning'])!,
|
||||
oauth: SystemConfigOAuthDto.fromJson(json[r'oauth'])!,
|
||||
passwordLogin: SystemConfigPasswordLoginDto.fromJson(json[r'passwordLogin'])!,
|
||||
storageTemplate: SystemConfigStorageTemplateDto.fromJson(json[r'storageTemplate'])!,
|
||||
@@ -129,6 +136,7 @@ class SystemConfigDto {
|
||||
static const requiredKeys = <String>{
|
||||
'ffmpeg',
|
||||
'job',
|
||||
'machineLearning',
|
||||
'oauth',
|
||||
'passwordLogin',
|
||||
'storageTemplate',
|
||||
|
||||
130
mobile/openapi/lib/model/system_config_machine_learning_dto.dart
generated
Normal file
130
mobile/openapi/lib/model/system_config_machine_learning_dto.dart
generated
Normal file
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// 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 SystemConfigMachineLearningDto {
|
||||
/// Returns a new [SystemConfigMachineLearningDto] instance.
|
||||
SystemConfigMachineLearningDto({
|
||||
required this.clipEncodeEnabled,
|
||||
required this.enabled,
|
||||
required this.facialRecognitionEnabled,
|
||||
required this.tagImageEnabled,
|
||||
required this.url,
|
||||
});
|
||||
|
||||
bool clipEncodeEnabled;
|
||||
|
||||
bool enabled;
|
||||
|
||||
bool facialRecognitionEnabled;
|
||||
|
||||
bool tagImageEnabled;
|
||||
|
||||
String url;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SystemConfigMachineLearningDto &&
|
||||
other.clipEncodeEnabled == clipEncodeEnabled &&
|
||||
other.enabled == enabled &&
|
||||
other.facialRecognitionEnabled == facialRecognitionEnabled &&
|
||||
other.tagImageEnabled == tagImageEnabled &&
|
||||
other.url == url;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(clipEncodeEnabled.hashCode) +
|
||||
(enabled.hashCode) +
|
||||
(facialRecognitionEnabled.hashCode) +
|
||||
(tagImageEnabled.hashCode) +
|
||||
(url.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SystemConfigMachineLearningDto[clipEncodeEnabled=$clipEncodeEnabled, enabled=$enabled, facialRecognitionEnabled=$facialRecognitionEnabled, tagImageEnabled=$tagImageEnabled, url=$url]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'clipEncodeEnabled'] = this.clipEncodeEnabled;
|
||||
json[r'enabled'] = this.enabled;
|
||||
json[r'facialRecognitionEnabled'] = this.facialRecognitionEnabled;
|
||||
json[r'tagImageEnabled'] = this.tagImageEnabled;
|
||||
json[r'url'] = this.url;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [SystemConfigMachineLearningDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static SystemConfigMachineLearningDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return SystemConfigMachineLearningDto(
|
||||
clipEncodeEnabled: mapValueOfType<bool>(json, r'clipEncodeEnabled')!,
|
||||
enabled: mapValueOfType<bool>(json, r'enabled')!,
|
||||
facialRecognitionEnabled: mapValueOfType<bool>(json, r'facialRecognitionEnabled')!,
|
||||
tagImageEnabled: mapValueOfType<bool>(json, r'tagImageEnabled')!,
|
||||
url: mapValueOfType<String>(json, r'url')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<SystemConfigMachineLearningDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <SystemConfigMachineLearningDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = SystemConfigMachineLearningDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, SystemConfigMachineLearningDto> mapFromJson(dynamic json) {
|
||||
final map = <String, SystemConfigMachineLearningDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = SystemConfigMachineLearningDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of SystemConfigMachineLearningDto-objects as value to a dart map
|
||||
static Map<String, List<SystemConfigMachineLearningDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<SystemConfigMachineLearningDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = SystemConfigMachineLearningDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'clipEncodeEnabled',
|
||||
'enabled',
|
||||
'facialRecognitionEnabled',
|
||||
'tagImageEnabled',
|
||||
'url',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user