date->string

This commit is contained in:
Min Idzelis
2025-05-03 13:33:58 +00:00
parent bf0be6a655
commit 73cd236756
6 changed files with 9 additions and 7 deletions

View File

@@ -99,8 +99,8 @@ export class TimeBucketAssetResponseDto implements TimeBucketAssets {
@ApiProperty({ type: [String] })
thumbhash: (string | null)[] = [];
@ApiProperty()
localDateTime: Date[] = [];
@ApiProperty({ type: [String] })
localDateTime: string[] = [];
@ApiProperty({ type: [String] })
duration: (string | null)[] = [];

View File

@@ -612,6 +612,7 @@ export class AssetRepository {
'exif.city as city',
'exif.country as country',
])
.select(sql<string>`to_json("localDateTime" at time zone 'UTC')#>>'{}'`.as('localDateTime'))
.$if(!!options.albumId, (qb) =>
qb
.innerJoin('albums_assets_assets', 'albums_assets_assets.assetsId', 'assets.id')

View File

@@ -20,7 +20,7 @@ export class TimelineService extends BaseService {
async getTimeBuckets(auth: AuthDto, dto: TimeBucketDto): Promise<TimeBucketsResponseDto[]> {
await this.timeBucketChecks(auth, dto);
const timeBucketOptions = await this.buildTimeBucketOptions(auth, dto);
return this.assetRepository.getTimeBuckets(timeBucketOptions);
return await this.assetRepository.getTimeBuckets(timeBucketOptions);
}
async getTimeBucket(auth: AuthDto, dto: TimeBucketAssetDto): Promise<TimeBucketResponseDto> {

View File

@@ -19,7 +19,7 @@ export type TimeBucketAssets = {
isVideo: number[];
isImage: number[];
thumbhash: (string | null)[];
localDateTime: Date[];
localDateTime: string[];
stack: (TimelineStack | null)[];
duration: (string | null)[];
projectionType: (string | null)[];