mirror of
https://github.com/immich-app/immich.git
synced 2025-04-15 12:16:52 +02:00
chore: remove unused upload property (#7535)
* chore: remove isExternal * chore: open-api
This commit is contained in:
parent
3d25d91e77
commit
15a4a4aaaa
6
mobile/openapi/doc/AssetApi.md
generated
6
mobile/openapi/doc/AssetApi.md
generated
@ -1401,7 +1401,7 @@ void (empty response body)
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **uploadFile**
|
# **uploadFile**
|
||||||
> AssetFileUploadResponseDto uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isExternal, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData)
|
> AssetFileUploadResponseDto uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1432,7 +1432,6 @@ final fileModifiedAt = 2013-10-20T19:20:30+01:00; // DateTime |
|
|||||||
final key = key_example; // String |
|
final key = key_example; // String |
|
||||||
final duration = duration_example; // String |
|
final duration = duration_example; // String |
|
||||||
final isArchived = true; // bool |
|
final isArchived = true; // bool |
|
||||||
final isExternal = true; // bool |
|
|
||||||
final isFavorite = true; // bool |
|
final isFavorite = true; // bool |
|
||||||
final isOffline = true; // bool |
|
final isOffline = true; // bool |
|
||||||
final isReadOnly = true; // bool |
|
final isReadOnly = true; // bool |
|
||||||
@ -1442,7 +1441,7 @@ final livePhotoData = BINARY_DATA_HERE; // MultipartFile |
|
|||||||
final sidecarData = BINARY_DATA_HERE; // MultipartFile |
|
final sidecarData = BINARY_DATA_HERE; // MultipartFile |
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isExternal, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData);
|
final result = api_instance.uploadFile(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key, duration, isArchived, isFavorite, isOffline, isReadOnly, isVisible, libraryId, livePhotoData, sidecarData);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling AssetApi->uploadFile: $e\n');
|
print('Exception when calling AssetApi->uploadFile: $e\n');
|
||||||
@ -1461,7 +1460,6 @@ Name | Type | Description | Notes
|
|||||||
**key** | **String**| | [optional]
|
**key** | **String**| | [optional]
|
||||||
**duration** | **String**| | [optional]
|
**duration** | **String**| | [optional]
|
||||||
**isArchived** | **bool**| | [optional]
|
**isArchived** | **bool**| | [optional]
|
||||||
**isExternal** | **bool**| | [optional]
|
|
||||||
**isFavorite** | **bool**| | [optional]
|
**isFavorite** | **bool**| | [optional]
|
||||||
**isOffline** | **bool**| | [optional]
|
**isOffline** | **bool**| | [optional]
|
||||||
**isReadOnly** | **bool**| | [optional]
|
**isReadOnly** | **bool**| | [optional]
|
||||||
|
14
mobile/openapi/lib/api/asset_api.dart
generated
14
mobile/openapi/lib/api/asset_api.dart
generated
@ -1676,8 +1676,6 @@ class AssetApi {
|
|||||||
///
|
///
|
||||||
/// * [bool] isArchived:
|
/// * [bool] isArchived:
|
||||||
///
|
///
|
||||||
/// * [bool] isExternal:
|
|
||||||
///
|
|
||||||
/// * [bool] isFavorite:
|
/// * [bool] isFavorite:
|
||||||
///
|
///
|
||||||
/// * [bool] isOffline:
|
/// * [bool] isOffline:
|
||||||
@ -1691,7 +1689,7 @@ class AssetApi {
|
|||||||
/// * [MultipartFile] livePhotoData:
|
/// * [MultipartFile] livePhotoData:
|
||||||
///
|
///
|
||||||
/// * [MultipartFile] sidecarData:
|
/// * [MultipartFile] sidecarData:
|
||||||
Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
|
Future<Response> uploadFileWithHttpInfo(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
|
||||||
// ignore: prefer_const_declarations
|
// ignore: prefer_const_declarations
|
||||||
final path = r'/asset/upload';
|
final path = r'/asset/upload';
|
||||||
|
|
||||||
@ -1739,10 +1737,6 @@ class AssetApi {
|
|||||||
hasFields = true;
|
hasFields = true;
|
||||||
mp.fields[r'isArchived'] = parameterToString(isArchived);
|
mp.fields[r'isArchived'] = parameterToString(isArchived);
|
||||||
}
|
}
|
||||||
if (isExternal != null) {
|
|
||||||
hasFields = true;
|
|
||||||
mp.fields[r'isExternal'] = parameterToString(isExternal);
|
|
||||||
}
|
|
||||||
if (isFavorite != null) {
|
if (isFavorite != null) {
|
||||||
hasFields = true;
|
hasFields = true;
|
||||||
mp.fields[r'isFavorite'] = parameterToString(isFavorite);
|
mp.fields[r'isFavorite'] = parameterToString(isFavorite);
|
||||||
@ -1806,8 +1800,6 @@ class AssetApi {
|
|||||||
///
|
///
|
||||||
/// * [bool] isArchived:
|
/// * [bool] isArchived:
|
||||||
///
|
///
|
||||||
/// * [bool] isExternal:
|
|
||||||
///
|
|
||||||
/// * [bool] isFavorite:
|
/// * [bool] isFavorite:
|
||||||
///
|
///
|
||||||
/// * [bool] isOffline:
|
/// * [bool] isOffline:
|
||||||
@ -1821,8 +1813,8 @@ class AssetApi {
|
|||||||
/// * [MultipartFile] livePhotoData:
|
/// * [MultipartFile] livePhotoData:
|
||||||
///
|
///
|
||||||
/// * [MultipartFile] sidecarData:
|
/// * [MultipartFile] sidecarData:
|
||||||
Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isExternal, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
|
Future<AssetFileUploadResponseDto?> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String? key, String? duration, bool? isArchived, bool? isFavorite, bool? isOffline, bool? isReadOnly, bool? isVisible, String? libraryId, MultipartFile? livePhotoData, MultipartFile? sidecarData, }) async {
|
||||||
final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key: key, duration: duration, isArchived: isArchived, isExternal: isExternal, isFavorite: isFavorite, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, libraryId: libraryId, livePhotoData: livePhotoData, sidecarData: sidecarData, );
|
final response = await uploadFileWithHttpInfo(assetData, deviceAssetId, deviceId, fileCreatedAt, fileModifiedAt, key: key, duration: duration, isArchived: isArchived, isFavorite: isFavorite, isOffline: isOffline, isReadOnly: isReadOnly, isVisible: isVisible, libraryId: libraryId, livePhotoData: livePhotoData, sidecarData: sidecarData, );
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
2
mobile/openapi/test/asset_api_test.dart
generated
2
mobile/openapi/test/asset_api_test.dart
generated
@ -135,7 +135,7 @@ void main() {
|
|||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
|
||||||
//Future<AssetFileUploadResponseDto> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String key, String duration, bool isArchived, bool isExternal, bool isFavorite, bool isOffline, bool isReadOnly, bool isVisible, String libraryId, MultipartFile livePhotoData, MultipartFile sidecarData }) async
|
//Future<AssetFileUploadResponseDto> uploadFile(MultipartFile assetData, String deviceAssetId, String deviceId, DateTime fileCreatedAt, DateTime fileModifiedAt, { String key, String duration, bool isArchived, bool isFavorite, bool isOffline, bool isReadOnly, bool isVisible, String libraryId, MultipartFile livePhotoData, MultipartFile sidecarData }) async
|
||||||
test('test uploadFile', () async {
|
test('test uploadFile', () async {
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
|
@ -7541,9 +7541,6 @@
|
|||||||
"isArchived": {
|
"isArchived": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"isExternal": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"isFavorite": {
|
"isFavorite": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
@ -289,7 +289,6 @@ export type CreateAssetDto = {
|
|||||||
fileCreatedAt: string;
|
fileCreatedAt: string;
|
||||||
fileModifiedAt: string;
|
fileModifiedAt: string;
|
||||||
isArchived?: boolean;
|
isArchived?: boolean;
|
||||||
isExternal?: boolean;
|
|
||||||
isFavorite?: boolean;
|
isFavorite?: boolean;
|
||||||
isOffline?: boolean;
|
isOffline?: boolean;
|
||||||
isReadOnly?: boolean;
|
isReadOnly?: boolean;
|
||||||
|
@ -341,7 +341,6 @@ export class AssetService {
|
|||||||
fileCreatedAt: dto.fileCreatedAt,
|
fileCreatedAt: dto.fileCreatedAt,
|
||||||
fileModifiedAt: dto.fileModifiedAt,
|
fileModifiedAt: dto.fileModifiedAt,
|
||||||
localDateTime: dto.fileCreatedAt,
|
localDateTime: dto.fileCreatedAt,
|
||||||
deletedAt: null,
|
|
||||||
|
|
||||||
type: mimeTypes.assetType(file.originalPath),
|
type: mimeTypes.assetType(file.originalPath),
|
||||||
isFavorite: dto.isFavorite,
|
isFavorite: dto.isFavorite,
|
||||||
@ -349,17 +348,9 @@ export class AssetService {
|
|||||||
duration: dto.duration || null,
|
duration: dto.duration || null,
|
||||||
isVisible: dto.isVisible ?? true,
|
isVisible: dto.isVisible ?? true,
|
||||||
livePhotoVideo: livePhotoAssetId === null ? null : ({ id: livePhotoAssetId } as AssetEntity),
|
livePhotoVideo: livePhotoAssetId === null ? null : ({ id: livePhotoAssetId } as AssetEntity),
|
||||||
resizePath: null,
|
|
||||||
webpPath: null,
|
|
||||||
thumbhash: null,
|
|
||||||
encodedVideoPath: null,
|
|
||||||
tags: [],
|
|
||||||
sharedLinks: [],
|
|
||||||
originalFileName: parse(file.originalName).name,
|
originalFileName: parse(file.originalName).name,
|
||||||
faces: [],
|
|
||||||
sidecarPath: sidecarPath || null,
|
sidecarPath: sidecarPath || null,
|
||||||
isReadOnly: dto.isReadOnly ?? false,
|
isReadOnly: dto.isReadOnly ?? false,
|
||||||
isExternal: dto.isExternal ?? false,
|
|
||||||
isOffline: dto.isOffline ?? false,
|
isOffline: dto.isOffline ?? false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,7 +3,10 @@ import { ApiProperty } from '@nestjs/swagger';
|
|||||||
import { Transform, Type } from 'class-transformer';
|
import { Transform, Type } from 'class-transformer';
|
||||||
import { IsBoolean, IsDate, IsNotEmpty, IsString } from 'class-validator';
|
import { IsBoolean, IsDate, IsNotEmpty, IsString } from 'class-validator';
|
||||||
|
|
||||||
export class CreateAssetBase {
|
export class CreateAssetDto {
|
||||||
|
@ValidateUUID({ optional: true })
|
||||||
|
libraryId?: string;
|
||||||
|
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
@IsString()
|
@IsString()
|
||||||
deviceAssetId!: string;
|
deviceAssetId!: string;
|
||||||
@ -22,6 +25,10 @@ export class CreateAssetBase {
|
|||||||
@Type(() => Date)
|
@Type(() => Date)
|
||||||
fileModifiedAt!: Date;
|
fileModifiedAt!: Date;
|
||||||
|
|
||||||
|
@Optional()
|
||||||
|
@IsString()
|
||||||
|
duration?: string;
|
||||||
|
|
||||||
@Optional()
|
@Optional()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
@Transform(toBoolean)
|
@Transform(toBoolean)
|
||||||
@ -37,28 +44,16 @@ export class CreateAssetBase {
|
|||||||
@Transform(toBoolean)
|
@Transform(toBoolean)
|
||||||
isVisible?: boolean;
|
isVisible?: boolean;
|
||||||
|
|
||||||
@Optional()
|
|
||||||
@IsString()
|
|
||||||
duration?: string;
|
|
||||||
|
|
||||||
@Optional()
|
|
||||||
@IsBoolean()
|
|
||||||
isExternal?: boolean;
|
|
||||||
|
|
||||||
@Optional()
|
@Optional()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
|
@Transform(toBoolean)
|
||||||
isOffline?: boolean;
|
isOffline?: boolean;
|
||||||
}
|
|
||||||
|
|
||||||
export class CreateAssetDto extends CreateAssetBase {
|
|
||||||
@Optional()
|
@Optional()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
@Transform(toBoolean)
|
@Transform(toBoolean)
|
||||||
isReadOnly?: boolean;
|
isReadOnly?: boolean;
|
||||||
|
|
||||||
@ValidateUUID({ optional: true })
|
|
||||||
libraryId?: string;
|
|
||||||
|
|
||||||
// The properties below are added to correctly generate the API docs
|
// The properties below are added to correctly generate the API docs
|
||||||
// and client SDKs. Validation should be handled in the controller.
|
// and client SDKs. Validation should be handled in the controller.
|
||||||
@ApiProperty({ type: 'string', format: 'binary' })
|
@ApiProperty({ type: 'string', format: 'binary' })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user