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:
Alex
2024-11-19 15:36:55 -06:00
committed by GitHub
parent 69e50d0d27
commit f8bbc6eabe
2 changed files with 7 additions and 1 deletions

View File

@@ -74,7 +74,7 @@ export class AlbumService extends BaseService {
startDate: albumMetadata[album.id].startDate,
endDate: albumMetadata[album.id].endDate,
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 album = await this.findOrFail(id, { withAssets });
const [albumMetadataForIds] = await this.albumRepository.getMetadataForIds([album.id]);
const lastModifiedAsset = await this.assetRepository.getLastUpdatedAssetForAlbumId(album.id);
return {
...mapAlbum(album, withAssets, auth),
startDate: albumMetadataForIds.startDate,
endDate: albumMetadataForIds.endDate,
assetCount: albumMetadataForIds.assetCount,
lastModifiedAssetTimestamp: lastModifiedAsset?.updatedAt,
};
}