mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +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",
|
"description": "base64 encoded sha1 hash",
|
||||||
"type": "string"
|
"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": {
|
"deviceAssetId": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|
@ -10855,6 +10861,7 @@
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"checksum",
|
"checksum",
|
||||||
|
"createdAt",
|
||||||
"deviceAssetId",
|
"deviceAssetId",
|
||||||
"deviceId",
|
"deviceId",
|
||||||
"duration",
|
"duration",
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,8 @@ export type TagResponseDto = {
|
||||||
export type AssetResponseDto = {
|
export type AssetResponseDto = {
|
||||||
/** base64 encoded sha1 hash */
|
/** base64 encoded sha1 hash */
|
||||||
checksum: string;
|
checksum: string;
|
||||||
|
/** The UTC timestamp when the asset was originally uploaded to Immich. */
|
||||||
|
createdAt: string;
|
||||||
deviceAssetId: string;
|
deviceAssetId: string;
|
||||||
deviceId: string;
|
deviceId: string;
|
||||||
duplicateId?: string | null;
|
duplicateId?: string | null;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,13 @@ export class SanitizedAssetResponseDto {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AssetResponseDto extends 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;
|
deviceAssetId!: string;
|
||||||
deviceId!: string;
|
deviceId!: string;
|
||||||
ownerId!: string;
|
ownerId!: string;
|
||||||
|
|
@ -190,6 +197,7 @@ export function mapAsset(entity: MapAsset, options: AssetMapOptions = {}): Asset
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: entity.id,
|
id: entity.id,
|
||||||
|
createdAt: entity.createdAt,
|
||||||
deviceAssetId: entity.deviceAssetId,
|
deviceAssetId: entity.deviceAssetId,
|
||||||
ownerId: entity.ownerId,
|
ownerId: entity.ownerId,
|
||||||
owner: entity.owner ? mapUser(entity.owner) : undefined,
|
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 = {
|
const assetResponse: AssetResponseDto = {
|
||||||
id: 'id_1',
|
id: 'id_1',
|
||||||
|
createdAt: today,
|
||||||
deviceAssetId: 'device_asset_id_1',
|
deviceAssetId: 'device_asset_id_1',
|
||||||
ownerId: 'user_id_1',
|
ownerId: 'user_id_1',
|
||||||
deviceId: 'device_id_1',
|
deviceId: 'device_id_1',
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { Sync } from 'factory.ts';
|
||||||
|
|
||||||
export const assetFactory = Sync.makeFactory<AssetResponseDto>({
|
export const assetFactory = Sync.makeFactory<AssetResponseDto>({
|
||||||
id: Sync.each(() => faker.string.uuid()),
|
id: Sync.each(() => faker.string.uuid()),
|
||||||
|
createdAt: Sync.each(() => faker.date.past().toISOString()),
|
||||||
deviceAssetId: Sync.each(() => faker.string.uuid()),
|
deviceAssetId: Sync.each(() => faker.string.uuid()),
|
||||||
ownerId: Sync.each(() => faker.string.uuid()),
|
ownerId: Sync.each(() => faker.string.uuid()),
|
||||||
deviceId: '',
|
deviceId: '',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue