mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
fix(server): do not link live photos across users (#2162)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { AssetSearchOptions, IAssetRepository, WithoutProperty } from '@app/domain';
|
||||
import { AssetSearchOptions, IAssetRepository, LivePhotoSearchOptions, WithoutProperty } from '@app/domain';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { FindOptionsRelations, FindOptionsWhere, In, IsNull, Not, Repository } from 'typeorm';
|
||||
@@ -52,10 +52,13 @@ export class AssetRepository implements IAssetRepository {
|
||||
});
|
||||
}
|
||||
|
||||
findLivePhotoMatch(livePhotoCID: string, otherAssetId: string, type: AssetType): Promise<AssetEntity | null> {
|
||||
findLivePhotoMatch(options: LivePhotoSearchOptions): Promise<AssetEntity | null> {
|
||||
const { ownerId, otherAssetId, livePhotoCID, type } = options;
|
||||
|
||||
return this.repository.findOne({
|
||||
where: {
|
||||
id: Not(otherAssetId),
|
||||
ownerId,
|
||||
type,
|
||||
exifInfo: {
|
||||
livePhotoCID,
|
||||
|
||||
Reference in New Issue
Block a user