feat(server, web): include pictures of shared albums on map (#7439)

* feat(server, web): include pictures of shared albums on map

* run prettier

* re-create api clients

* implement suggestions from code review

* shared from partner -> shared from partners

* rename to 'include shared partner assets'

* chore: fix tsc error in server and prettier in web

* fix: include assets shared via owner albums

---------

Co-authored-by: Zack Pollard <zackpollard@ymail.com>
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Andreas Gerstmayr
2024-05-13 15:28:57 +02:00
committed by GitHub
parent d121903b38
commit 48927f5fb9
13 changed files with 81 additions and 24 deletions

View File

@@ -490,9 +490,24 @@ export class AssetRepository implements IAssetRepository {
});
}
async getMapMarkers(ownerIds: string[], options: MapMarkerSearchOptions = {}): Promise<MapMarker[]> {
async getMapMarkers(
ownerIds: string[],
albumIds: string[],
options: MapMarkerSearchOptions = {},
): Promise<MapMarker[]> {
const { isArchived, isFavorite, fileCreatedAfter, fileCreatedBefore } = options;
const where = {
isVisible: true,
isArchived,
exifInfo: {
latitude: Not(IsNull()),
longitude: Not(IsNull()),
},
isFavorite,
fileCreatedAt: OptionalBetween(fileCreatedAfter, fileCreatedBefore),
};
const assets = await this.repository.find({
select: {
id: true,
@@ -504,17 +519,10 @@ export class AssetRepository implements IAssetRepository {
longitude: true,
},
},
where: {
ownerId: In([...ownerIds]),
isVisible: true,
isArchived,
exifInfo: {
latitude: Not(IsNull()),
longitude: Not(IsNull()),
},
isFavorite,
fileCreatedAt: OptionalBetween(fileCreatedAfter, fileCreatedBefore),
},
where: [
{ ...where, ownerId: In([...ownerIds]) },
{ ...where, albums: { id: In([...albumIds]) } },
],
relations: {
exifInfo: true,
},