mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 04:05:39 -04:00
fix: mobile album sync always triggered when opening the app (#14233)
* fix: mobile album sync always triggered when opening the app * send lastModifiedAssetTimestamp when get individual album
This commit is contained in:
parent
69e50d0d27
commit
f8bbc6eabe
@ -141,6 +141,7 @@ describe('/albums', () => {
|
|||||||
expect(body).toEqual({
|
expect(body).toEqual({
|
||||||
...user1Albums[0],
|
...user1Albums[0],
|
||||||
assets: [expect.objectContaining({ isFavorite: false })],
|
assets: [expect.objectContaining({ isFavorite: false })],
|
||||||
|
lastModifiedAssetTimestamp: expect.any(String),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -297,6 +298,7 @@ describe('/albums', () => {
|
|||||||
expect(body).toEqual({
|
expect(body).toEqual({
|
||||||
...user1Albums[0],
|
...user1Albums[0],
|
||||||
assets: [expect.objectContaining({ id: user1Albums[0].assets[0].id })],
|
assets: [expect.objectContaining({ id: user1Albums[0].assets[0].id })],
|
||||||
|
lastModifiedAssetTimestamp: expect.any(String),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -327,6 +329,7 @@ describe('/albums', () => {
|
|||||||
expect(body).toEqual({
|
expect(body).toEqual({
|
||||||
...user1Albums[0],
|
...user1Albums[0],
|
||||||
assets: [expect.objectContaining({ id: user1Albums[0].assets[0].id })],
|
assets: [expect.objectContaining({ id: user1Albums[0].assets[0].id })],
|
||||||
|
lastModifiedAssetTimestamp: expect.any(String),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -340,6 +343,7 @@ describe('/albums', () => {
|
|||||||
...user1Albums[0],
|
...user1Albums[0],
|
||||||
assets: [],
|
assets: [],
|
||||||
assetCount: 1,
|
assetCount: 1,
|
||||||
|
lastModifiedAssetTimestamp: expect.any(String),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -74,7 +74,7 @@ export class AlbumService extends BaseService {
|
|||||||
startDate: albumMetadata[album.id].startDate,
|
startDate: albumMetadata[album.id].startDate,
|
||||||
endDate: albumMetadata[album.id].endDate,
|
endDate: albumMetadata[album.id].endDate,
|
||||||
assetCount: albumMetadata[album.id].assetCount,
|
assetCount: albumMetadata[album.id].assetCount,
|
||||||
lastModifiedAssetTimestamp: lastModifiedAsset?.fileModifiedAt,
|
lastModifiedAssetTimestamp: lastModifiedAsset?.updatedAt,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@ -86,12 +86,14 @@ export class AlbumService extends BaseService {
|
|||||||
const withAssets = dto.withoutAssets === undefined ? true : !dto.withoutAssets;
|
const withAssets = dto.withoutAssets === undefined ? true : !dto.withoutAssets;
|
||||||
const album = await this.findOrFail(id, { withAssets });
|
const album = await this.findOrFail(id, { withAssets });
|
||||||
const [albumMetadataForIds] = await this.albumRepository.getMetadataForIds([album.id]);
|
const [albumMetadataForIds] = await this.albumRepository.getMetadataForIds([album.id]);
|
||||||
|
const lastModifiedAsset = await this.assetRepository.getLastUpdatedAssetForAlbumId(album.id);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...mapAlbum(album, withAssets, auth),
|
...mapAlbum(album, withAssets, auth),
|
||||||
startDate: albumMetadataForIds.startDate,
|
startDate: albumMetadataForIds.startDate,
|
||||||
endDate: albumMetadataForIds.endDate,
|
endDate: albumMetadataForIds.endDate,
|
||||||
assetCount: albumMetadataForIds.assetCount,
|
assetCount: albumMetadataForIds.assetCount,
|
||||||
|
lastModifiedAssetTimestamp: lastModifiedAsset?.updatedAt,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user