feat: manual stack assets (#4198)
This commit is contained in:
@@ -109,6 +109,7 @@ export class AssetRepository implements IAssetRepository {
|
||||
faces: {
|
||||
person: true,
|
||||
},
|
||||
stack: true,
|
||||
},
|
||||
// We are specifically asking for this asset. Return it even if it is soft deleted
|
||||
withDeleted: true,
|
||||
@@ -131,6 +132,7 @@ export class AssetRepository implements IAssetRepository {
|
||||
relations: {
|
||||
exifInfo: true,
|
||||
tags: true,
|
||||
stack: true,
|
||||
},
|
||||
skip: dto.skip || 0,
|
||||
order: {
|
||||
|
||||
@@ -196,7 +196,7 @@ export class AssetService {
|
||||
const includeMetadata = this.getExifPermission(authUser);
|
||||
const asset = await this._assetRepository.getById(assetId);
|
||||
if (includeMetadata) {
|
||||
const data = mapAsset(asset);
|
||||
const data = mapAsset(asset, { withStack: true });
|
||||
|
||||
if (data.ownerId !== authUser.id) {
|
||||
data.people = [];
|
||||
@@ -208,7 +208,7 @@ export class AssetService {
|
||||
|
||||
return data;
|
||||
} else {
|
||||
return mapAsset(asset, true);
|
||||
return mapAsset(asset, { stripMetadata: true, withStack: true });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
TimeBucketResponseDto,
|
||||
TrashAction,
|
||||
UpdateAssetDto as UpdateDto,
|
||||
UpdateStackParentDto,
|
||||
} from '@app/domain';
|
||||
import {
|
||||
Body,
|
||||
@@ -137,6 +138,12 @@ export class AssetController {
|
||||
return this.service.handleTrashAction(authUser, TrashAction.RESTORE_ALL);
|
||||
}
|
||||
|
||||
@Put('stack/parent')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
updateStackParent(@AuthUser() authUser: AuthUserDto, @Body() dto: UpdateStackParentDto): Promise<void> {
|
||||
return this.service.updateStackParent(authUser, dto);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
updateAsset(
|
||||
@AuthUser() authUser: AuthUserDto,
|
||||
|
||||
Reference in New Issue
Block a user