1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-24 04:46:50 +02:00

feat(server): multi archive downloads (#956)

This commit is contained in:
Jason Rasmussen
2022-11-15 10:51:56 -05:00
committed by GitHub
parent b5d75e2016
commit f2f255e6e6
26 changed files with 538 additions and 151 deletions

View File

@ -246,6 +246,57 @@ class AssetApi {
return null;
}
/// Performs an HTTP 'GET /asset/download-library' operation and returns the [Response].
/// Parameters:
///
/// * [num] skip:
Future<Response> downloadLibraryWithHttpInfo({ num? skip, }) async {
// ignore: prefer_const_declarations
final path = r'/asset/download-library';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (skip != null) {
queryParams.addAll(_queryParams('', 'skip', skip));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [num] skip:
Future<Object?> downloadLibrary({ num? skip, }) async {
final response = await downloadLibraryWithHttpInfo( skip: skip, );
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), 'Object',) as Object;
}
return null;
}
///
///
/// Get all AssetEntity belong to the user