fix(server): asset count on meta tag of shared links (#9107)

* fix asset count on meta tag of shared links

* fix lint

* fix style

* add e2e tests
This commit is contained in:
Nguyễn Hoàng Đức 2024-04-28 01:56:13 +07:00 committed by GitHub
parent cf01ec1eb0
commit 833a78181b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 2 deletions

View file

@ -185,7 +185,7 @@ export class SharedLinkService {
const sharedLink = await this.findOrFail(auth.sharedLink.userId, auth.sharedLink.id);
const assetId = sharedLink.album?.albumThumbnailAssetId || sharedLink.assets[0]?.id;
const assetCount = sharedLink.assets.length ?? sharedLink.album?.assets.length ?? 0;
const assetCount = sharedLink.assets.length > 0 ? sharedLink.assets.length : sharedLink.album?.assets.length || 0;
return {
title: sharedLink.album ? sharedLink.album.albumName : 'Public Share',