-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server, web): include pictures of shared albums on map #7439
Changes from 1 commit
93cca06
f30c44c
9e37377
fa66cea
40da6ee
ab39adf
a1f3bff
06640ba
15169de
8c2a4e9
803d977
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,10 @@ export class MapMarkerDto { | |
@IsBoolean() | ||
@Transform(toBoolean) | ||
withPartners?: boolean; | ||
|
||
@ApiProperty() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be needed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 The class got moved to |
||
@Optional() | ||
@IsBoolean() | ||
@Transform(toBoolean) | ||
withSharedAlbums?: boolean; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -500,7 +500,7 @@ 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 assets = await this.repository.find({ | ||
|
@@ -511,19 +511,35 @@ export class AssetRepository implements IAssetRepository { | |
longitude: true, | ||
}, | ||
}, | ||
where: { | ||
ownerId: In([...ownerIds]), | ||
isVisible: true, | ||
isArchived, | ||
exifInfo: { | ||
latitude: Not(IsNull()), | ||
longitude: Not(IsNull()), | ||
where: [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a better way to write this OR expression? |
||
{ | ||
ownerId: In([...ownerIds]), | ||
isVisible: true, | ||
isArchived, | ||
exifInfo: { | ||
latitude: Not(IsNull()), | ||
longitude: Not(IsNull()), | ||
}, | ||
isFavorite, | ||
fileCreatedAt: OptionalBetween(fileCreatedAfter, fileCreatedBefore), | ||
}, | ||
isFavorite, | ||
fileCreatedAt: OptionalBetween(fileCreatedAfter, fileCreatedBefore), | ||
}, | ||
{ | ||
albums: { | ||
id: In([...albumIds]) | ||
}, | ||
isVisible: true, | ||
isArchived, | ||
exifInfo: { | ||
latitude: Not(IsNull()), | ||
longitude: Not(IsNull()), | ||
}, | ||
isFavorite, | ||
fileCreatedAt: OptionalBetween(fileCreatedAfter, fileCreatedBefore), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section is repeated twice. Can you move it up to a variable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, done. |
||
} | ||
], | ||
relations: { | ||
exifInfo: true, | ||
albums: true, | ||
}, | ||
order: { | ||
fileCreatedAt: 'DESC', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
<SettingSwitch title="Only favorites" bind:checked={settings.onlyFavorites} /> | ||
<SettingSwitch title="Include archived" bind:checked={settings.includeArchived} /> | ||
<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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we remember this other option so it is more obvious what the difference is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed What do you think, which option sounds better? Or do you have other suggestions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not Jason but I would suggest There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed it to |
||
{#if customDateRange} | ||
<div in:fly={{ y: 10, duration: 200 }} class="flex flex-col gap-4"> | ||
<div class="flex items-center justify-between gap-8"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't include the asset relation does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, where should I include the asset relation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this function does not query all assets, only the albums:
immich/server/src/repositories/album.repository.ts
Lines 154 to 166 in f667c95