mirror of
https://github.com/samsonjs/immich.git
synced 2026-03-25 09:15:56 +00:00
feat: expose createdAt in getAssetInfo (#21184)
* Expose createdAt in getAssetInfo * Add missing createdAt fields
This commit is contained in:
parent
c2313f7a99
commit
5fb8d651ec
6 changed files with 19 additions and 0 deletions
BIN
mobile/openapi/lib/model/asset_response_dto.dart
generated
BIN
mobile/openapi/lib/model/asset_response_dto.dart
generated
Binary file not shown.
|
|
@ -10720,6 +10720,12 @@
|
|||
"description": "base64 encoded sha1 hash",
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"description": "The UTC timestamp when the asset was originally uploaded to Immich.",
|
||||
"example": "2024-01-15T20:30:00.000Z",
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
"deviceAssetId": {
|
||||
"type": "string"
|
||||
},
|
||||
|
|
@ -10855,6 +10861,7 @@
|
|||
},
|
||||
"required": [
|
||||
"checksum",
|
||||
"createdAt",
|
||||
"deviceAssetId",
|
||||
"deviceId",
|
||||
"duration",
|
||||
|
|
|
|||
|
|
@ -317,6 +317,8 @@ export type TagResponseDto = {
|
|||
export type AssetResponseDto = {
|
||||
/** base64 encoded sha1 hash */
|
||||
checksum: string;
|
||||
/** The UTC timestamp when the asset was originally uploaded to Immich. */
|
||||
createdAt: string;
|
||||
deviceAssetId: string;
|
||||
deviceId: string;
|
||||
duplicateId?: string | null;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,13 @@ export class SanitizedAssetResponseDto {
|
|||
}
|
||||
|
||||
export class AssetResponseDto extends SanitizedAssetResponseDto {
|
||||
@ApiProperty({
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
description: 'The UTC timestamp when the asset was originally uploaded to Immich.',
|
||||
example: '2024-01-15T20:30:00.000Z',
|
||||
})
|
||||
createdAt!: Date;
|
||||
deviceAssetId!: string;
|
||||
deviceId!: string;
|
||||
ownerId!: string;
|
||||
|
|
@ -190,6 +197,7 @@ export function mapAsset(entity: MapAsset, options: AssetMapOptions = {}): Asset
|
|||
|
||||
return {
|
||||
id: entity.id,
|
||||
createdAt: entity.createdAt,
|
||||
deviceAssetId: entity.deviceAssetId,
|
||||
ownerId: entity.ownerId,
|
||||
owner: entity.owner ? mapUser(entity.owner) : undefined,
|
||||
|
|
|
|||
1
server/test/fixtures/shared-link.stub.ts
vendored
1
server/test/fixtures/shared-link.stub.ts
vendored
|
|
@ -46,6 +46,7 @@ const assetInfo: ExifResponseDto = {
|
|||
|
||||
const assetResponse: AssetResponseDto = {
|
||||
id: 'id_1',
|
||||
createdAt: today,
|
||||
deviceAssetId: 'device_asset_id_1',
|
||||
ownerId: 'user_id_1',
|
||||
deviceId: 'device_id_1',
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { Sync } from 'factory.ts';
|
|||
|
||||
export const assetFactory = Sync.makeFactory<AssetResponseDto>({
|
||||
id: Sync.each(() => faker.string.uuid()),
|
||||
createdAt: Sync.each(() => faker.date.past().toISOString()),
|
||||
deviceAssetId: Sync.each(() => faker.string.uuid()),
|
||||
ownerId: Sync.each(() => faker.string.uuid()),
|
||||
deviceId: '',
|
||||
|
|
|
|||
Loading…
Reference in a new issue