mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
feat: pass filename in body on asset upload (#19138)
* chore: get upload filename from request body * use info from request body
This commit is contained in:
parent
5cd186d3d4
commit
176656b5f4
5 changed files with 13 additions and 1 deletions
BIN
mobile/openapi/lib/api/assets_api.dart
generated
BIN
mobile/openapi/lib/api/assets_api.dart
generated
Binary file not shown.
|
|
@ -9401,6 +9401,9 @@
|
||||||
"format": "date-time",
|
"format": "date-time",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"filename": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"isFavorite": {
|
"isFavorite": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
|
@ -9451,6 +9454,9 @@
|
||||||
"fileModifiedAt": {
|
"fileModifiedAt": {
|
||||||
"format": "date-time",
|
"format": "date-time",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"filename": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|
|
||||||
|
|
@ -444,6 +444,7 @@ export type AssetMediaCreateDto = {
|
||||||
duration?: string;
|
duration?: string;
|
||||||
fileCreatedAt: string;
|
fileCreatedAt: string;
|
||||||
fileModifiedAt: string;
|
fileModifiedAt: string;
|
||||||
|
filename?: string;
|
||||||
isFavorite?: boolean;
|
isFavorite?: boolean;
|
||||||
livePhotoVideoId?: string;
|
livePhotoVideoId?: string;
|
||||||
sidecarData?: Blob;
|
sidecarData?: Blob;
|
||||||
|
|
@ -510,6 +511,7 @@ export type AssetMediaReplaceDto = {
|
||||||
duration?: string;
|
duration?: string;
|
||||||
fileCreatedAt: string;
|
fileCreatedAt: string;
|
||||||
fileModifiedAt: string;
|
fileModifiedAt: string;
|
||||||
|
filename?: string;
|
||||||
};
|
};
|
||||||
export type SignUpDto = {
|
export type SignUpDto = {
|
||||||
email: string;
|
email: string;
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@ class AssetMediaBase {
|
||||||
@IsString()
|
@IsString()
|
||||||
duration?: string;
|
duration?: string;
|
||||||
|
|
||||||
|
@Optional()
|
||||||
|
@IsString()
|
||||||
|
filename?: 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' })
|
||||||
|
|
|
||||||
|
|
@ -418,7 +418,7 @@ export class AssetMediaService extends BaseService {
|
||||||
duration: dto.duration || null,
|
duration: dto.duration || null,
|
||||||
visibility: dto.visibility ?? AssetVisibility.TIMELINE,
|
visibility: dto.visibility ?? AssetVisibility.TIMELINE,
|
||||||
livePhotoVideoId: dto.livePhotoVideoId,
|
livePhotoVideoId: dto.livePhotoVideoId,
|
||||||
originalFileName: file.originalName,
|
originalFileName: dto.filename || file.originalName,
|
||||||
sidecarPath: sidecarFile?.originalPath,
|
sidecarPath: sidecarFile?.originalPath,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue