-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat: expose createdAt in getAssetInfo #21184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: expose createdAt in getAssetInfo #21184
Conversation
|
|
||
| return { | ||
| id: entity.id, | ||
| createdAt: entity.createdAt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need some kind of test case to verify that this is present, or is the ts compiler validating it enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this it's fine
| } | ||
|
|
||
| export class AssetResponseDto extends SanitizedAssetResponseDto { | ||
| @ApiProperty({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this automatically go to the API docs in CI, or do I need to run something to rebuild the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generating the open-api specs (what you did) is all it takes :)
danieldietzler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* Expose createdAt in getAssetInfo * Add missing createdAt fields
Description
Exposed the createdAt field in the response for getAssetInfo. This is useful for writing scripts that do something based on when an asset was uploaded. For example, the other day I imported my Google Photos library, and wanted to write a script to tag all of the photos I uploaded that day.
Today, someone on Discord asked for a way to delete recently uploaded assets:
How Has This Been Tested?
Uploaded an asset, then looked at the API response and verified that the new field is present:
API Changes
The
/api/assetendpoint now exposescreatedAt.Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)