0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-02-11 01:18:24 -05:00
fixed issue #8352
This commit is contained in:
ZlabiDev 2024-04-01 18:06:25 +02:00 committed by GitHub
parent 27be813011
commit ee4d9fff16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

4
server/src/services/asset.service.spec.ts Normal file → Executable file
View file

@ -311,13 +311,15 @@ describe(AssetService.name, () => {
const image1 = { ...assetStub.image, localDateTime: new Date(2023, 1, 15, 0, 0, 0) };
const image2 = { ...assetStub.image, localDateTime: new Date(2023, 1, 15, 1, 0, 0) };
const image3 = { ...assetStub.image, localDateTime: new Date(2015, 1, 15) };
const image4 = { ...assetStub.image, localDateTime: new Date(2009, 1, 15) };
partnerMock.getAll.mockResolvedValue([]);
assetMock.getByDayOfYear.mockResolvedValue([image1, image2, image3]);
assetMock.getByDayOfYear.mockResolvedValue([image1, image2, image3, image4]);
await expect(sut.getMemoryLane(authStub.admin, { day: 15, month: 1 })).resolves.toEqual([
{ yearsAgo: 1, title: '1 year since...', assets: [mapAsset(image1), mapAsset(image2)] },
{ yearsAgo: 9, title: '9 years since...', assets: [mapAsset(image3)] },
{ yearsAgo: 15, title: '15 years since...', assets: [mapAsset(image4)] },
]);
expect(assetMock.getByDayOfYear.mock.calls).toEqual([[[authStub.admin.user.id], { day: 15, month: 1 }]]);

View file

@ -184,7 +184,7 @@ export class AssetService {
return Object.keys(groups)
.map(Number)
.sort()
.sort((a, b) => a - b)
.filter((yearsAgo) => yearsAgo > 0)
.map((yearsAgo) => ({
yearsAgo,