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:
Alex
2022-09-05 00:18:53 -05:00
committed by GitHub
parent 172eda3ce5
commit 6976a7241e
8 changed files with 46 additions and 13 deletions
@@ -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,