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

@ -48,7 +48,7 @@ class TimeBucketAssetResponseDto {
List<String> livePhotoVideoId;
List<DateTime> localDateTime;
List<String> localDateTime;
List<String> ownerId;
@ -154,7 +154,9 @@ class TimeBucketAssetResponseDto {
livePhotoVideoId: json[r'livePhotoVideoId'] is Iterable
? (json[r'livePhotoVideoId'] as Iterable).cast<String>().toList(growable: false)
: const [],
localDateTime: DateTime.listFromJson(json[r'localDateTime']),
localDateTime: json[r'localDateTime'] is Iterable
? (json[r'localDateTime'] as Iterable).cast<String>().toList(growable: false)
: const [],
ownerId: json[r'ownerId'] is Iterable
? (json[r'ownerId'] as Iterable).cast<String>().toList(growable: false)
: const [],

View File

@ -13627,7 +13627,6 @@
"localDateTime": {
"default": [],
"items": {
"format": "date-time",
"type": "string"
},
"type": "array"

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)[];