Use nulls, make-sql

This commit is contained in:
Min Idzelis
2025-05-03 02:06:34 +00:00
parent 0ed2a2fd2e
commit aea2c9506d
19 changed files with 186 additions and 205 deletions

View File

@@ -183,7 +183,7 @@ export function mapAsset(entity: MapAsset, options: AssetMapOptions = {}): Asset
tags: entity.tags?.map((tag) => mapTag(tag)),
people: peopleWithFaces(entity.faces),
unassignedFaces: entity.faces?.filter((face) => !face.person).map((a) => mapFacesWithoutPerson(a)),
checksum: hexOrBufferToBase64(entity.checksum),
checksum: hexOrBufferToBase64(entity.checksum)!,
stack: withStack ? mapStack(entity) : undefined,
isOffline: entity.isOffline,
hasMetadata: true,

View File

@@ -104,12 +104,12 @@ export class TimeBucketAssetResponseDto implements TimeBucketAssets {
type: 'string',
},
{
type: 'number',
type: 'null',
},
],
},
})
thumbhash: (string | number)[] = [];
thumbhash: (string | null)[] = [];
@ApiProperty()
localDateTime: Date[] = [];
@@ -122,15 +122,27 @@ export class TimeBucketAssetResponseDto implements TimeBucketAssets {
type: 'string',
},
{
type: 'number',
type: 'null',
},
],
},
})
duration: (string | number)[] = [];
duration: (string | null)[] = [];
@ApiProperty({ type: [TimelineStackResponseDto] })
stack: (TimelineStackResponseDto | number)[] = [];
@ApiProperty({
type: 'array',
items: {
oneOf: [
{
type: 'TimelineStackResponseDto',
},
{
type: 'null',
},
],
},
})
stack: (TimelineStackResponseDto | null)[] = [];
@ApiProperty({
type: 'array',
@@ -140,12 +152,12 @@ export class TimeBucketAssetResponseDto implements TimeBucketAssets {
type: 'string',
},
{
type: 'number',
type: 'null',
},
],
},
})
projectionType: (string | number)[] = [];
projectionType: (string | null)[] = [];
@ApiProperty({
type: 'array',
@@ -155,12 +167,12 @@ export class TimeBucketAssetResponseDto implements TimeBucketAssets {
type: 'string',
},
{
type: 'number',
type: 'null',
},
],
},
})
livePhotoVideoId: (string | number)[] = [];
livePhotoVideoId: (string | null)[] = [];
@ApiProperty()
description: TimelineAssetDescriptionDto[] = [];