chore: remove unused upload property (#7535)

* chore: remove isExternal

* chore: open-api
This commit is contained in:
Jason Rasmussen
2024-02-29 16:02:08 -05:00
committed by GitHub
parent 3d25d91e77
commit 15a4a4aaaa
7 changed files with 15 additions and 43 deletions

View File

@@ -341,7 +341,6 @@ export class AssetService {
fileCreatedAt: dto.fileCreatedAt,
fileModifiedAt: dto.fileModifiedAt,
localDateTime: dto.fileCreatedAt,
deletedAt: null,
type: mimeTypes.assetType(file.originalPath),
isFavorite: dto.isFavorite,
@@ -349,17 +348,9 @@ export class AssetService {
duration: dto.duration || null,
isVisible: dto.isVisible ?? true,
livePhotoVideo: livePhotoAssetId === null ? null : ({ id: livePhotoAssetId } as AssetEntity),
resizePath: null,
webpPath: null,
thumbhash: null,
encodedVideoPath: null,
tags: [],
sharedLinks: [],
originalFileName: parse(file.originalName).name,
faces: [],
sidecarPath: sidecarPath || null,
isReadOnly: dto.isReadOnly ?? false,
isExternal: dto.isExternal ?? false,
isOffline: dto.isOffline ?? false,
});

View File

@@ -3,7 +3,10 @@ import { ApiProperty } from '@nestjs/swagger';
import { Transform, Type } from 'class-transformer';
import { IsBoolean, IsDate, IsNotEmpty, IsString } from 'class-validator';
export class CreateAssetBase {
export class CreateAssetDto {
@ValidateUUID({ optional: true })
libraryId?: string;
@IsNotEmpty()
@IsString()
deviceAssetId!: string;
@@ -22,6 +25,10 @@ export class CreateAssetBase {
@Type(() => Date)
fileModifiedAt!: Date;
@Optional()
@IsString()
duration?: string;
@Optional()
@IsBoolean()
@Transform(toBoolean)
@@ -37,28 +44,16 @@ export class CreateAssetBase {
@Transform(toBoolean)
isVisible?: boolean;
@Optional()
@IsString()
duration?: string;
@Optional()
@IsBoolean()
isExternal?: boolean;
@Optional()
@IsBoolean()
@Transform(toBoolean)
isOffline?: boolean;
}
export class CreateAssetDto extends CreateAssetBase {
@Optional()
@IsBoolean()
@Transform(toBoolean)
isReadOnly?: boolean;
@ValidateUUID({ optional: true })
libraryId?: string;
// The properties below are added to correctly generate the API docs
// and client SDKs. Validation should be handled in the controller.
@ApiProperty({ type: 'string', format: 'binary' })