mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(server): file sending and cache control (#5829)
* fix: file sending * fix: tests
This commit is contained in:
parent
ffc31f034c
commit
d3e1572229
17 changed files with 132 additions and 98 deletions
|
|
@ -12,10 +12,11 @@ import {
|
|||
PersonStatisticsResponseDto,
|
||||
PersonUpdateDto,
|
||||
} from '@app/domain';
|
||||
import { Body, Controller, Get, Param, Post, Put, Query } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Next, Param, Post, Put, Query, Res } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { NextFunction, Response } from 'express';
|
||||
import { Auth, Authenticated, FileResponse } from '../app.guard';
|
||||
import { UseValidation } from '../app.utils';
|
||||
import { UseValidation, sendFile } from '../app.utils';
|
||||
import { UUIDParamDto } from './dto/uuid-param.dto';
|
||||
|
||||
@ApiTags('Person')
|
||||
|
|
@ -70,8 +71,13 @@ export class PersonController {
|
|||
|
||||
@Get(':id/thumbnail')
|
||||
@FileResponse()
|
||||
getPersonThumbnail(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto) {
|
||||
return this.service.getThumbnail(auth, id);
|
||||
async getPersonThumbnail(
|
||||
@Res() res: Response,
|
||||
@Next() next: NextFunction,
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id }: UUIDParamDto,
|
||||
) {
|
||||
await sendFile(res, next, () => this.service.getThumbnail(auth, id));
|
||||
}
|
||||
|
||||
@Get(':id/assets')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue