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

refactor(server): download file (#1512)

* refactor(server): download file

* chore: generate open-api and remove unused refs

* chore(server): tests

* chore: remove unused code
This commit is contained in:
Jason Rasmussen
2023-02-03 10:16:25 -05:00
committed by GitHub
parent e39507552f
commit 2b0b2bb1ae
29 changed files with 210 additions and 291 deletions

View File

@ -234,11 +234,7 @@ class AssetApi {
/// Parameters:
///
/// * [String] assetId (required):
///
/// * [bool] isThumb:
///
/// * [bool] isWeb:
Future<Response> downloadFileWithHttpInfo(String assetId, { bool? isThumb, bool? isWeb, }) async {
Future<Response> downloadFileWithHttpInfo(String assetId,) async {
// ignore: prefer_const_declarations
final path = r'/asset/download/{assetId}'
.replaceAll('{assetId}', assetId);
@ -250,13 +246,6 @@ class AssetApi {
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (isThumb != null) {
queryParams.addAll(_queryParams('', 'isThumb', isThumb));
}
if (isWeb != null) {
queryParams.addAll(_queryParams('', 'isWeb', isWeb));
}
const contentTypes = <String>[];
@ -276,12 +265,8 @@ class AssetApi {
/// Parameters:
///
/// * [String] assetId (required):
///
/// * [bool] isThumb:
///
/// * [bool] isWeb:
Future<Object?> downloadFile(String assetId, { bool? isThumb, bool? isWeb, }) async {
final response = await downloadFileWithHttpInfo(assetId, isThumb: isThumb, isWeb: isWeb, );
Future<Object?> downloadFile(String assetId,) async {
final response = await downloadFileWithHttpInfo(assetId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}