You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-10 23:22:22 +02:00
Fixed upload asset to album in asset selection (#579)
* Fixed error uploading a file from album * Fixed album selection mode show viewing asset stage * Navigate back after uploading asset to album
This commit is contained in:
@@ -123,12 +123,12 @@ export class AssetController {
|
||||
}
|
||||
|
||||
@Get('/thumbnail/:assetId')
|
||||
@Header('Cache-Control', 'max-age=300')
|
||||
async getAssetThumbnail(
|
||||
@Response({ passthrough: true }) res: Res,
|
||||
@Param('assetId') assetId: string,
|
||||
@Query(new ValidationPipe({ transform: true })) query: GetAssetThumbnailDto,
|
||||
): Promise<any> {
|
||||
return this.assetService.getAssetThumbnail(assetId, query);
|
||||
return this.assetService.getAssetThumbnail(assetId, query, res);
|
||||
}
|
||||
|
||||
@Get('/curated-objects')
|
||||
|
@@ -165,7 +165,7 @@ export class AssetService {
|
||||
}
|
||||
}
|
||||
|
||||
public async getAssetThumbnail(assetId: string, query: GetAssetThumbnailDto) {
|
||||
public async getAssetThumbnail(assetId: string, query: GetAssetThumbnailDto, res: Res) {
|
||||
let fileReadStream: ReadStream;
|
||||
|
||||
const asset = await this.assetRepository.findOne({ where: { id: assetId } });
|
||||
@@ -196,8 +196,10 @@ export class AssetService {
|
||||
}
|
||||
}
|
||||
|
||||
res.header('Cache-Control', 'max-age=300');
|
||||
return new StreamableFile(fileReadStream);
|
||||
} catch (e) {
|
||||
res.header('Cache-Control', 'none');
|
||||
Logger.error(`Cannot create read stream for asset ${asset.id}`, 'getAssetThumbnail');
|
||||
throw new InternalServerErrorException(
|
||||
e,
|
||||
|
Reference in New Issue
Block a user