Repository navigation
feat(server, web): include pictures of shared albums on map - #7439
Conversation
| exifInfo: { | ||
| latitude: Not(IsNull()), | ||
| longitude: Not(IsNull()), | ||
| where: [ |
There was a problem hiding this comment.
Is there a better way to write this OR expression?
WHERE (ownerID IN ... OR albumId IN ...) AND isVisible = ... AND isArchived = ... AND ...
jrasm91
left a comment
There was a problem hiding this comment.
This looks really good. Thanks!
| } | ||
| return this.assetRepository.getMapMarkers(userIds, options); | ||
| if (options.withSharedAlbums) { | ||
| const sharedAlbums = await this.albumRepository.getShared(auth.user.id); |
There was a problem hiding this comment.
This doesn't include the asset relation does it?
There was a problem hiding this comment.
I don't understand, where should I include the asset relation?
There was a problem hiding this comment.
Okay so Jason answered me on Discord about this:
https://discord.com/channels/979116623879368755/994044917355663450/1238973376349864108
Jason said: "Just want to make sure this is not loading the album AND all the assets for it"
I said: "If I understand correctly, you are asking if it is loading only the shared albums when figuring out what to show on the map, versus loding the shared albums and all the assets. And the problem with that is loading all the assets in the shared album takes more resources."
Jason responded: "Yup"
There was a problem hiding this comment.
yes, this function does not query all assets, only the albums:
immich/server/src/repositories/album.repository.ts
Lines 154 to 166 in f667c95
| @Transform(toBoolean) | ||
| withPartners?: boolean; | ||
|
|
||
| @ApiProperty() |
There was a problem hiding this comment.
👍
The class got moved to server/src/dtos/search.dto.ts and doesn't have this annotation anymore.
| isVisible: true, | ||
| isArchived, | ||
| exifInfo: { | ||
| latitude: Not(IsNull()), | ||
| longitude: Not(IsNull()), | ||
| }, | ||
| isFavorite, | ||
| fileCreatedAt: OptionalBetween(fileCreatedAfter, fileCreatedBefore), |
There was a problem hiding this comment.
This section is repeated twice. Can you move it up to a variable?
There was a problem hiding this comment.
Good idea, done.
| <SettingSwitch title="Include shared with me" bind:checked={settings.withPartners} /> | ||
| <SettingSwitch title="Include shared albums" bind:checked={settings.withSharedAlbums} /> |
There was a problem hiding this comment.
Should we remember this other option so it is more obvious what the difference is?
There was a problem hiding this comment.
I renamed Include shared with me to Include shared from partners. Another option would be Include assets from partners.
What do you think, which option sounds better? Or do you have other suggestions?
There was a problem hiding this comment.
I'm not Jason but I would suggest Include partner assets or Include shared partner assets. Also, this rename is important for clarity.
There was a problem hiding this comment.
I renamed it to Include shared partner assets now, thanks for the suggestion @NicholasFlamy
|
@andreasgerstmayr You've requested a review from me but you haven't yet addressed @jrasm91 comments and there are also lots of merge conflicts right now...? |
hi @danieldietzler, sorry about that, must have been some automated process (it's showing up as 2:35 in the night), maybe because you're listed as a codeowner. No idea why it's happening now and not when I created the PR though. Sorry for the late response, I was on holiday for a couple of weeks and then didn't get time so far. |
|
Ah ok got it. No rush then :) |
|
I fixed the merge conflicts and implemented (most of) @jrasm91 suggestions now (except the one I didn't understand, see above). |
zackpollard
left a comment
There was a problem hiding this comment.
LGTM, will let @jrasm91 take a look over it before we merge though
|
I fixed a tsc error caused by changes in main since the branch was created as well as a prettier error in web. The PR should now be good to merge |
jrasm91
left a comment
There was a problem hiding this comment.
I updated this to include assets that are in shared albums where the user is the owner.
Good catch! I didn't think of that. Thank you for merging! :) |
This PR adds a new setting "Include shared albums" to the map settings, to includes pictures of albums shared with the current user on the map.
Related: #3176