mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: getAssetOcr endpoint (#23331)
* feat: getAssetOcr endpoint * pr feedback
This commit is contained in:
parent
8d25f81bec
commit
9098717c55
12 changed files with 560 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ import {
|
|||
UpdateAssetDto,
|
||||
} from 'src/dtos/asset.dto';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
import { AssetOcrResponseDto } from 'src/dtos/ocr.dto';
|
||||
import { Permission, RouteKey } from 'src/enum';
|
||||
import { Auth, Authenticated } from 'src/middleware/auth.guard';
|
||||
import { AssetService } from 'src/services/asset.service';
|
||||
|
|
@ -95,6 +96,12 @@ export class AssetController {
|
|||
return this.service.getMetadata(auth, id);
|
||||
}
|
||||
|
||||
@Get(':id/ocr')
|
||||
@Authenticated({ permission: Permission.AssetRead })
|
||||
getAssetOcr(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<AssetOcrResponseDto[]> {
|
||||
return this.service.getOcr(auth, id);
|
||||
}
|
||||
|
||||
@Put(':id/metadata')
|
||||
@Authenticated({ permission: Permission.AssetUpdate })
|
||||
updateAssetMetadata(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue