1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-10 23:22:22 +02:00

feat: use stream for template migrations (#16700)

This commit is contained in:
Jason Rasmussen
2025-03-07 14:30:01 -05:00
committed by GitHub
parent c12986d38c
commit f82786a297
6 changed files with 226 additions and 208 deletions

View File

@@ -3,6 +3,7 @@ import { AssetEntity } from 'src/entities/asset.entity';
import { ExifEntity } from 'src/entities/exif.entity';
import { StackEntity } from 'src/entities/stack.entity';
import { AssetFileType, AssetStatus, AssetType } from 'src/enum';
import { StorageAsset } from 'src/types';
import { authStub } from 'test/fixtures/auth.stub';
import { fileStub } from 'test/fixtures/file.stub';
import { libraryStub } from 'test/fixtures/library.stub';
@@ -40,6 +41,21 @@ export const stackStub = (stackId: string, assets: AssetEntity[]): StackEntity =
};
export const assetStub = {
storageAsset: (asset: Partial<StorageAsset> = {}) => ({
id: 'asset-id',
ownerId: 'user-id',
livePhotoVideoId: null,
type: AssetType.IMAGE,
isExternal: false,
checksum: Buffer.from('file hash'),
timeZone: null,
fileCreatedAt: new Date('2022-06-19T23:41:36.910Z'),
originalPath: '/original/path.jpg',
originalFileName: 'IMG_123.jpg',
sidecarPath: null,
fileSizeInByte: 12_345,
...asset,
}),
noResizePath: Object.freeze<AssetEntity>({
id: 'asset-id',
status: AssetStatus.ACTIVE,