Skip to content

High performance self-hosted photo and video management solution.

fix: include partner shared assets for people even without showInTimeline (#32219)

Daniel Dietzler5fa7789e2672
diff --git a/server/src/services/person.service.spec.ts b/server/src/services/person.service.spec.ts
index 4584823d47..01319f81f3 100644
--- a/server/src/services/person.service.spec.ts
+++ b/server/src/services/person.service.spec.ts
@@ -1491,7 +1491,7 @@ describe(PersonService.name, () => {
expect(mocks.access.person.checkAccess).toHaveBeenCalledWith(auth.user.id, new Set(ids), PERSON_READ_ROLES);
});
- it('should only include partners that are shown in the timeline', async () => {
+ it('should include all partners that are shown in the timeline', async () => {
const auth = AuthFactory.create();
const person = PersonFactory.create();
const ids = [{ personGroupId: person.personGroupId, ownerId: auth.user.id }];
@@ -1507,7 +1507,7 @@ describe(PersonService.name, () => {
await expect(sut.getStatistics(auth, person.personGroupId)).resolves.toEqual({ assets: 3 });
expect(mocks.person.getStatistics).toHaveBeenCalledWith(person.personGroupId, {
ownerId: auth.user.id,
- partnerIds: [inTimeline.id],
+ partnerIds: [inTimeline.id, notInTimeline.id],
});
});
diff --git a/server/src/services/person.service.ts b/server/src/services/person.service.ts
index 52908b6d2b..4109b019b3 100644
--- a/server/src/services/person.service.ts
+++ b/server/src/services/person.service.ts
@@ -80,7 +80,6 @@ export class PersonService extends BaseService {
const partnerIds = await getMyPartnerIds({
userId: auth.user.id,
repository: this.partnerRepository,
- timelineEnabled: true,
});
const { items, hasNextPage } = await this.personRepository.getAllForUser(pagination, auth.user.id, {
withHidden,
@@ -213,7 +212,6 @@ export class PersonService extends BaseService {
const partnerIds = await getMyPartnerIds({
userId: auth.user.id,
repository: this.partnerRepository,
- timelineEnabled: true,
});
return this.personRepository.getStatistics(personGroupId, { ownerId: auth.user.id, partnerIds });
}
diff --git a/server/src/services/timeline.service.ts b/server/src/services/timeline.service.ts
index 0fe5597c7b..1be8080d24 100644
--- a/server/src/services/timeline.service.ts
+++ b/server/src/services/timeline.service.ts
@@ -35,7 +35,7 @@ export class TimelineService extends BaseService {
const partnerIds = await getMyPartnerIds({
userId: auth.user.id,
repository: this.partnerRepository,
- timelineEnabled: true,
+ timelineEnabled: !options.personId || undefined,
});
userIds.push(...partnerIds);
}