Skip to content

Commit

Permalink
Add asset filehash (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kluskey authored Mar 27, 2024
1 parent 29d0468 commit 5d11b2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mirror-web-server/src/asset/asset.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export class AssetPublicData {
isSoftDeleted: boolean
@ApiProperty()
softDeletedAt: string
@ApiProperty()
fileHash: string
}

export type AssetDocument = Asset & Document // Note: we also have subclasses/disciminators for materials and textures (as of 2023-02-04 20:18:08). Walkthrough: https://www.loom.com/share/7e09d2777ef94368bcd5fd8c8341b5ef
Expand Down Expand Up @@ -207,6 +209,10 @@ export class Asset {
@ApiProperty()
currentFile: string

@Prop({ required: false })
@ApiProperty()
fileHash?: string

// Transform properties.
@Prop({})
@ApiProperty()
Expand Down
5 changes: 5 additions & 0 deletions mirror-web-server/src/asset/dto/create-asset.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export class CreateAssetDto {
@ApiProperty({ required: false })
currentFile?: string

@IsOptional()
@MaxLength(64)
@ApiProperty({ required: false })
fileHash?: string

@IsOptional()
@IsBoolean()
@ApiProperty({ required: false })
Expand Down

0 comments on commit 5d11b2c

Please sign in to comment.