mirror of
https://github.com/immich-app/immich.git
synced 2025-02-18 01:24:26 -05:00
Update map.repository.ts
Fixes assets in multiple albums from being counted more than once. Query returns only one row per unique asset. Tested and working!
This commit is contained in:
parent
194c567a45
commit
9750ab62fb
1 changed files with 2 additions and 0 deletions
|
@ -82,6 +82,7 @@ export class MapRepository {
|
|||
|
||||
return this.db
|
||||
.selectFrom('assets')
|
||||
.distinctOn(['assets.id'])
|
||||
.innerJoin('exif', (builder) =>
|
||||
builder
|
||||
.onRef('assets.id', '=', 'exif.assetId')
|
||||
|
@ -109,6 +110,7 @@ export class MapRepository {
|
|||
|
||||
return builder.or(expression);
|
||||
})
|
||||
.orderBy('assets.id', 'asc')
|
||||
.orderBy('fileCreatedAt', 'desc')
|
||||
.execute() as Promise<MapMarker[]>;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue