fix(server): include archived assets in forced thumbnail generation (#10409)
This commit is contained in:
@@ -132,6 +132,31 @@ describe(MediaService.name, () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('should queue archived assets when force is true', async () => {
|
||||
assetMock.getAll.mockResolvedValue({
|
||||
items: [assetStub.archived],
|
||||
hasNextPage: false,
|
||||
});
|
||||
personMock.getAll.mockResolvedValue({
|
||||
items: [],
|
||||
hasNextPage: false,
|
||||
});
|
||||
|
||||
await sut.handleQueueGenerateThumbnails({ force: true });
|
||||
|
||||
expect(assetMock.getAll).toHaveBeenCalledWith(
|
||||
{ skip: 0, take: 1000 },
|
||||
expect.objectContaining({ withArchived: true }),
|
||||
);
|
||||
expect(assetMock.getWithout).not.toHaveBeenCalled();
|
||||
expect(jobMock.queueAll).toHaveBeenCalledWith([
|
||||
{
|
||||
name: JobName.GENERATE_PREVIEW,
|
||||
data: { id: assetStub.archived.id },
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('should queue all people with missing thumbnail path', async () => {
|
||||
assetMock.getWithout.mockResolvedValue({
|
||||
items: [assetStub.image],
|
||||
|
||||
Reference in New Issue
Block a user