feat: asset metadata (#20446)

This commit is contained in:
Jason Rasmussen
2025-08-27 14:31:23 -04:00
committed by GitHub
parent 25a94bd117
commit 88072910da
37 changed files with 1999 additions and 21 deletions
+313 -1
View File
@@ -2245,6 +2245,203 @@
"description": "This endpoint requires the `asset.update` permission."
}
},
"/assets/{id}/metadata": {
"get": {
"operationId": "getAssetMetadata",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/AssetMetadataResponseDto"
},
"type": "array"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Assets"
],
"x-immich-permission": "asset.read",
"description": "This endpoint requires the `asset.read` permission."
},
"put": {
"operationId": "updateAssetMetadata",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetMetadataUpsertDto"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/AssetMetadataResponseDto"
},
"type": "array"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Assets"
],
"x-immich-permission": "asset.update",
"description": "This endpoint requires the `asset.update` permission."
}
},
"/assets/{id}/metadata/{key}": {
"delete": {
"operationId": "deleteAssetMetadata",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"name": "key",
"required": true,
"in": "path",
"schema": {
"$ref": "#/components/schemas/AssetMetadataKey"
}
}
],
"responses": {
"204": {
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Assets"
],
"x-immich-permission": "asset.update",
"description": "This endpoint requires the `asset.update` permission."
},
"get": {
"operationId": "getAssetMetadataByKey",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"format": "uuid",
"type": "string"
}
},
{
"name": "key",
"required": true,
"in": "path",
"schema": {
"$ref": "#/components/schemas/AssetMetadataKey"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetMetadataResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Assets"
],
"x-immich-permission": "asset.read",
"description": "This endpoint requires the `asset.read` permission."
}
},
"/assets/{id}/original": {
"get": {
"operationId": "downloadAsset",
@@ -10615,6 +10812,12 @@
"format": "uuid",
"type": "string"
},
"metadata": {
"items": {
"$ref": "#/components/schemas/AssetMetadataUpsertItemDto"
},
"type": "array"
},
"sidecarData": {
"format": "binary",
"type": "string"
@@ -10632,7 +10835,8 @@
"deviceAssetId",
"deviceId",
"fileCreatedAt",
"fileModifiedAt"
"fileModifiedAt",
"metadata"
],
"type": "object"
},
@@ -10707,6 +10911,69 @@
],
"type": "string"
},
"AssetMetadataKey": {
"enum": [
"mobile-app"
],
"type": "string"
},
"AssetMetadataResponseDto": {
"properties": {
"key": {
"allOf": [
{
"$ref": "#/components/schemas/AssetMetadataKey"
}
]
},
"updatedAt": {
"format": "date-time",
"type": "string"
},
"value": {
"type": "object"
}
},
"required": [
"key",
"updatedAt",
"value"
],
"type": "object"
},
"AssetMetadataUpsertDto": {
"properties": {
"items": {
"items": {
"$ref": "#/components/schemas/AssetMetadataUpsertItemDto"
},
"type": "array"
}
},
"required": [
"items"
],
"type": "object"
},
"AssetMetadataUpsertItemDto": {
"properties": {
"key": {
"allOf": [
{
"$ref": "#/components/schemas/AssetMetadataKey"
}
]
},
"value": {
"type": "object"
}
},
"required": [
"key",
"value"
],
"type": "object"
},
"AssetOrder": {
"enum": [
"asc",
@@ -14944,6 +15211,48 @@
],
"type": "object"
},
"SyncAssetMetadataDeleteV1": {
"properties": {
"assetId": {
"type": "string"
},
"key": {
"allOf": [
{
"$ref": "#/components/schemas/AssetMetadataKey"
}
]
}
},
"required": [
"assetId",
"key"
],
"type": "object"
},
"SyncAssetMetadataV1": {
"properties": {
"assetId": {
"type": "string"
},
"key": {
"allOf": [
{
"$ref": "#/components/schemas/AssetMetadataKey"
}
]
},
"value": {
"type": "object"
}
},
"required": [
"assetId",
"key",
"value"
],
"type": "object"
},
"SyncAssetV1": {
"properties": {
"checksum": {
@@ -15114,6 +15423,8 @@
"AssetV1",
"AssetDeleteV1",
"AssetExifV1",
"AssetMetadataV1",
"AssetMetadataDeleteV1",
"PartnerV1",
"PartnerDeleteV1",
"PartnerAssetV1",
@@ -15373,6 +15684,7 @@
"AlbumAssetExifsV1",
"AssetsV1",
"AssetExifsV1",
"AssetMetadataV1",
"AuthUsersV1",
"MemoriesV1",
"MemoryToAssetsV1",