fix(server): assets in multiple albums duplicated in map view (#16245)
This commit is contained in:
@@ -23,7 +23,6 @@ import {
|
||||
withTags,
|
||||
} from 'src/entities/asset.entity';
|
||||
import { AssetFileType, AssetOrder, AssetStatus, AssetType } from 'src/enum';
|
||||
import { MapMarker, MapMarkerSearchOptions } from 'src/repositories/map.repository';
|
||||
import { AssetSearchOptions, SearchExploreItem, SearchExploreItemSet } from 'src/repositories/search.repository';
|
||||
import { anyUuid, asUuid, mapUpsertColumns } from 'src/utils/database';
|
||||
import { Paginated, PaginationOptions, paginationHelper } from 'src/utils/pagination';
|
||||
@@ -639,26 +638,6 @@ export class AssetRepository {
|
||||
.executeTakeFirst() as Promise<AssetEntity | undefined>;
|
||||
}
|
||||
|
||||
private getMapMarkers(ownerIds: string[], options: MapMarkerSearchOptions = {}): Promise<MapMarker[]> {
|
||||
const { isArchived, isFavorite, fileCreatedAfter, fileCreatedBefore } = options;
|
||||
|
||||
return this.db
|
||||
.selectFrom('assets')
|
||||
.leftJoin('exif', 'assets.id', 'exif.assetId')
|
||||
.select(['id', 'latitude as lat', 'longitude as lon', 'city', 'state', 'country'])
|
||||
.where('ownerId', '=', anyUuid(ownerIds))
|
||||
.where('latitude', 'is not', null)
|
||||
.where('longitude', 'is not', null)
|
||||
.where('isVisible', '=', true)
|
||||
.where('deletedAt', 'is', null)
|
||||
.$if(!!isArchived, (qb) => qb.where('isArchived', '=', isArchived!))
|
||||
.$if(!!isFavorite, (qb) => qb.where('isFavorite', '=', isFavorite!))
|
||||
.$if(!!fileCreatedAfter, (qb) => qb.where('fileCreatedAt', '>=', fileCreatedAfter!))
|
||||
.$if(!!fileCreatedBefore, (qb) => qb.where('fileCreatedAt', '<=', fileCreatedBefore!))
|
||||
.orderBy('fileCreatedAt', 'desc')
|
||||
.execute() as Promise<MapMarker[]>;
|
||||
}
|
||||
|
||||
getStatistics(ownerId: string, { isArchived, isFavorite, isTrashed }: AssetStatsOptions): Promise<AssetStats> {
|
||||
return this.db
|
||||
.selectFrom('assets')
|
||||
|
||||
Reference in New Issue
Block a user