mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(server): improve validation of albums (#2188)
* feat(server): improve validation of albums * regenerate openapi + fix downloadArchive for web
This commit is contained in:
13
mobile/openapi/lib/api/album_api.dart
generated
13
mobile/openapi/lib/api/album_api.dart
generated
@@ -295,10 +295,12 @@ class AlbumApi {
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [String] name:
|
||||
///
|
||||
/// * [num] skip:
|
||||
///
|
||||
/// * [String] key:
|
||||
Future<Response> downloadArchiveWithHttpInfo(String albumId, { num? skip, String? key, }) async {
|
||||
Future<Response> downloadArchiveWithHttpInfo(String albumId, { String? name, num? skip, String? key, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/album/{albumId}/download'
|
||||
.replaceAll('{albumId}', albumId);
|
||||
@@ -310,6 +312,9 @@ class AlbumApi {
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
if (name != null) {
|
||||
queryParams.addAll(_queryParams('', 'name', name));
|
||||
}
|
||||
if (skip != null) {
|
||||
queryParams.addAll(_queryParams('', 'skip', skip));
|
||||
}
|
||||
@@ -337,11 +342,13 @@ class AlbumApi {
|
||||
///
|
||||
/// * [String] albumId (required):
|
||||
///
|
||||
/// * [String] name:
|
||||
///
|
||||
/// * [num] skip:
|
||||
///
|
||||
/// * [String] key:
|
||||
Future<MultipartFile?> downloadArchive(String albumId, { num? skip, String? key, }) async {
|
||||
final response = await downloadArchiveWithHttpInfo(albumId, skip: skip, key: key, );
|
||||
Future<MultipartFile?> downloadArchive(String albumId, { String? name, num? skip, String? key, }) async {
|
||||
final response = await downloadArchiveWithHttpInfo(albumId, name: name, skip: skip, key: key, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
|
||||
13
mobile/openapi/lib/api/asset_api.dart
generated
13
mobile/openapi/lib/api/asset_api.dart
generated
@@ -422,10 +422,12 @@ class AssetApi {
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] name:
|
||||
///
|
||||
/// * [num] skip:
|
||||
///
|
||||
/// * [String] key:
|
||||
Future<Response> downloadLibraryWithHttpInfo({ num? skip, String? key, }) async {
|
||||
Future<Response> downloadLibraryWithHttpInfo({ String? name, num? skip, String? key, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/download-library';
|
||||
|
||||
@@ -436,6 +438,9 @@ class AssetApi {
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
if (name != null) {
|
||||
queryParams.addAll(_queryParams('', 'name', name));
|
||||
}
|
||||
if (skip != null) {
|
||||
queryParams.addAll(_queryParams('', 'skip', skip));
|
||||
}
|
||||
@@ -461,11 +466,13 @@ class AssetApi {
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] name:
|
||||
///
|
||||
/// * [num] skip:
|
||||
///
|
||||
/// * [String] key:
|
||||
Future<MultipartFile?> downloadLibrary({ num? skip, String? key, }) async {
|
||||
final response = await downloadLibraryWithHttpInfo( skip: skip, key: key, );
|
||||
Future<MultipartFile?> downloadLibrary({ String? name, num? skip, String? key, }) async {
|
||||
final response = await downloadLibraryWithHttpInfo( name: name, skip: skip, key: key, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class CreateAlbumShareLinkDto {
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
String? expiresAt;
|
||||
DateTime? expiresAt;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
@@ -89,7 +89,7 @@ class CreateAlbumShareLinkDto {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'albumId'] = this.albumId;
|
||||
if (this.expiresAt != null) {
|
||||
json[r'expiresAt'] = this.expiresAt;
|
||||
json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String();
|
||||
} else {
|
||||
// json[r'expiresAt'] = null;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class CreateAlbumShareLinkDto {
|
||||
|
||||
return CreateAlbumShareLinkDto(
|
||||
albumId: mapValueOfType<String>(json, r'albumId')!,
|
||||
expiresAt: mapValueOfType<String>(json, r'expiresAt'),
|
||||
expiresAt: mapDateTime(json, r'expiresAt', ''),
|
||||
allowUpload: mapValueOfType<bool>(json, r'allowUpload'),
|
||||
allowDownload: mapValueOfType<bool>(json, r'allowDownload'),
|
||||
showExif: mapValueOfType<bool>(json, r'showExif'),
|
||||
|
||||
Reference in New Issue
Block a user