mirror of
https://github.com/immich-app/immich.git
synced 2026-08-02 00:48:08 -07:00
fix: emit album update event when uploading assets through shared link (#29757)
This commit is contained in:
@@ -342,9 +342,20 @@ export class AssetMediaService extends BaseService {
|
||||
}
|
||||
|
||||
private async addToSharedLink(sharedLink: AuthSharedLink, assetId: string) {
|
||||
await (sharedLink.albumId
|
||||
? this.albumRepository.addAssetIds(sharedLink.albumId, [assetId])
|
||||
: this.sharedLinkRepository.addAssets(sharedLink.id, [assetId]));
|
||||
if (!sharedLink.albumId) {
|
||||
await this.sharedLinkRepository.addAssets(sharedLink.id, [assetId]);
|
||||
return;
|
||||
}
|
||||
|
||||
const album = await this.albumRepository.getById(sharedLink.albumId, { withAssets: false });
|
||||
if (!album) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.albumRepository.addAssetIds(album.id, [assetId]);
|
||||
for (const { user } of album.albumUsers) {
|
||||
await this.eventRepository.emit('AlbumUpdate', { id: album.id, recipientId: user.id });
|
||||
}
|
||||
}
|
||||
|
||||
private requireQuota(auth: AuthDto, size: number) {
|
||||
|
||||
Reference in New Issue
Block a user