lint/tests

This commit is contained in:
Min Idzelis 2025-05-03 13:58:46 +00:00
parent ee08fd012d
commit 5520db10af
3 changed files with 8 additions and 7 deletions

View File

@ -272,6 +272,7 @@ select
"exif"."projectionType",
"exif"."city" as "city",
"exif"."country" as "country",
to_json("localDateTime" at time zone 'UTC') #>> '{}' as "localDateTime",
to_json("stacked_assets") as "stack"
from
"assets"

View File

@ -53,15 +53,15 @@ describe('AssetStore', () => {
expect(plainBuckets).toEqual(
expect.arrayContaining([
expect.objectContaining({ bucketDate: '2024-03-01T00:00:00.000Z', bucketHeight: 186.5 }),
expect.objectContaining({ bucketDate: '2024-02-01T00:00:00.000Z', bucketHeight: 12_017 }),
expect.objectContaining({ bucketDate: '2024-03-01T00:00:00.000Z', bucketHeight: 185.5 }),
expect.objectContaining({ bucketDate: '2024-02-01T00:00:00.000Z', bucketHeight: 12_016 }),
expect.objectContaining({ bucketDate: '2024-01-01T00:00:00.000Z', bucketHeight: 286 }),
]),
);
});
it('calculates timeline height', () => {
expect(assetStore.timelineHeight).toBe(12_489.5);
expect(assetStore.timelineHeight).toBe(12487.5);
});
});

View File

@ -75,20 +75,20 @@ export const toResponseDto = (...timelineAsset: TimelineAsset[]) => {
};
for (const asset of timelineAsset) {
bucketAssets.description.push(asset.description);
bucketAssets.duration.push(asset.duration);
bucketAssets.duration.push(asset.duration!);
bucketAssets.id.push(asset.id);
bucketAssets.isArchived.push(asset.isArchived ? 1 : 0);
bucketAssets.isFavorite.push(asset.isFavorite ? 1 : 0);
bucketAssets.isImage.push(asset.isImage ? 1 : 0);
bucketAssets.isTrashed.push(asset.isTrashed ? 1 : 0);
bucketAssets.isVideo.push(asset.isVideo ? 1 : 0);
bucketAssets.livePhotoVideoId.push(asset.livePhotoVideoId);
bucketAssets.livePhotoVideoId.push(asset.livePhotoVideoId!);
bucketAssets.localDateTime.push(asset.localDateTime);
bucketAssets.ownerId.push(asset.ownerId);
bucketAssets.projectionType.push(asset.projectionType);
bucketAssets.projectionType.push(asset.projectionType!);
bucketAssets.ratio.push(asset.ratio);
bucketAssets.stack.push(asset.stack as TimelineStackResponseDto);
bucketAssets.thumbhash.push(asset.thumbhash);
bucketAssets.thumbhash.push(asset.thumbhash!);
}
const response: TimeBucketResponseDto = {
bucketAssets,