mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
fix: withFilePath select edited or unedited file (#27328)
* fix: withFilePath select edited or unedited file * chore: test
This commit is contained in:
parent
4ef777d145
commit
c29493e3a0
6 changed files with 43 additions and 19 deletions
|
|
@ -115,4 +115,33 @@ describe(AssetJobRepository.name, () => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getForOcr', () => {
|
||||
it('should not return the edited preview file', async () => {
|
||||
const { ctx, sut } = setup();
|
||||
const { user } = await ctx.newUser();
|
||||
const { asset } = await ctx.newAsset({ ownerId: user.id });
|
||||
|
||||
await ctx.newAssetFile({
|
||||
assetId: asset.id,
|
||||
type: AssetFileType.Preview,
|
||||
path: 'preview_edited.jpg',
|
||||
isEdited: true,
|
||||
});
|
||||
await ctx.newAssetFile({
|
||||
assetId: asset.id,
|
||||
type: AssetFileType.Preview,
|
||||
path: 'preview_unedited.jpg',
|
||||
isEdited: false,
|
||||
});
|
||||
|
||||
const result = await sut.getForOcr(asset.id);
|
||||
|
||||
expect(result).toEqual(
|
||||
expect.objectContaining({
|
||||
previewFile: 'preview_unedited.jpg',
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue