diff --git a/cli/src/api/open-api/api.ts b/cli/src/api/open-api/api.ts index 4d0bf0f469..fb194b7fa4 100644 --- a/cli/src/api/open-api/api.ts +++ b/cli/src/api/open-api/api.ts @@ -6278,13 +6278,14 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration }, /** * + * @param {boolean} [isArchived] * @param {boolean} [isFavorite] * @param {string} [fileCreatedAfter] * @param {string} [fileCreatedBefore] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getMapMarkers: async (isFavorite?: boolean, fileCreatedAfter?: string, fileCreatedBefore?: string, options: AxiosRequestConfig = {}): Promise => { + getMapMarkers: async (isArchived?: boolean, isFavorite?: boolean, fileCreatedAfter?: string, fileCreatedBefore?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/asset/map-marker`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -6306,6 +6307,10 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) + if (isArchived !== undefined) { + localVarQueryParameter['isArchived'] = isArchived; + } + if (isFavorite !== undefined) { localVarQueryParameter['isFavorite'] = isFavorite; } @@ -7134,14 +7139,15 @@ export const AssetApiFp = function(configuration?: Configuration) { }, /** * + * @param {boolean} [isArchived] * @param {boolean} [isFavorite] * @param {string} [fileCreatedAfter] * @param {string} [fileCreatedBefore] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getMapMarkers(isFavorite?: boolean, fileCreatedAfter?: string, fileCreatedBefore?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getMapMarkers(isFavorite, fileCreatedAfter, fileCreatedBefore, options); + async getMapMarkers(isArchived?: boolean, isFavorite?: boolean, fileCreatedAfter?: string, fileCreatedBefore?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMapMarkers(isArchived, isFavorite, fileCreatedAfter, fileCreatedBefore, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -7428,7 +7434,7 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getMapMarkers(requestParameters: AssetApiGetMapMarkersRequest = {}, options?: AxiosRequestConfig): AxiosPromise> { - return localVarFp.getMapMarkers(requestParameters.isFavorite, requestParameters.fileCreatedAfter, requestParameters.fileCreatedBefore, options).then((request) => request(axios, basePath)); + return localVarFp.getMapMarkers(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.fileCreatedAfter, requestParameters.fileCreatedBefore, options).then((request) => request(axios, basePath)); }, /** * @@ -7846,6 +7852,13 @@ export interface AssetApiGetDownloadInfoRequest { * @interface AssetApiGetMapMarkersRequest */ export interface AssetApiGetMapMarkersRequest { + /** + * + * @type {boolean} + * @memberof AssetApiGetMapMarkers + */ + readonly isArchived?: boolean + /** * * @type {boolean} @@ -8374,7 +8387,7 @@ export class AssetApi extends BaseAPI { * @memberof AssetApi */ public getMapMarkers(requestParameters: AssetApiGetMapMarkersRequest = {}, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).getMapMarkers(requestParameters.isFavorite, requestParameters.fileCreatedAfter, requestParameters.fileCreatedBefore, options).then((request) => request(this.axios, this.basePath)); + return AssetApiFp(this.configuration).getMapMarkers(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.fileCreatedAfter, requestParameters.fileCreatedBefore, options).then((request) => request(this.axios, this.basePath)); } /** diff --git a/mobile/assets/i18n/en-US.json b/mobile/assets/i18n/en-US.json index 94bd4b7dd0..935e880d8a 100644 --- a/mobile/assets/i18n/en-US.json +++ b/mobile/assets/i18n/en-US.json @@ -312,6 +312,7 @@ "map_settings_dialog_title": "Map Settings", "map_settings_dark_mode": "Dark mode", "map_settings_only_show_favorites": "Show Favorite Only", + "map_settings_include_show_archived": "Include Archived", "map_settings_only_relative_range": "Date range", "map_settings_dialog_cancel": "Cancel", "map_settings_dialog_save": "Save", diff --git a/mobile/lib/modules/map/models/map_state.model.dart b/mobile/lib/modules/map/models/map_state.model.dart index ed2b033fdf..7aab8efab3 100644 --- a/mobile/lib/modules/map/models/map_state.model.dart +++ b/mobile/lib/modules/map/models/map_state.model.dart @@ -1,29 +1,33 @@ class MapState { final bool isDarkTheme; final bool showFavoriteOnly; + final bool includeArchived; final int relativeTime; MapState({ this.isDarkTheme = false, this.showFavoriteOnly = false, + this.includeArchived = false, this.relativeTime = 0, }); MapState copyWith({ bool? isDarkTheme, bool? showFavoriteOnly, + bool? includeArchived, int? relativeTime, }) { return MapState( isDarkTheme: isDarkTheme ?? this.isDarkTheme, showFavoriteOnly: showFavoriteOnly ?? this.showFavoriteOnly, + includeArchived: includeArchived ?? this.includeArchived, relativeTime: relativeTime ?? this.relativeTime, ); } @override String toString() { - return 'MapSettingsState(isDarkTheme: $isDarkTheme, showFavoriteOnly: $showFavoriteOnly, relativeTime: $relativeTime)'; + return 'MapSettingsState(isDarkTheme: $isDarkTheme, showFavoriteOnly: $showFavoriteOnly, relativeTime: $relativeTime, includeArchived: $includeArchived)'; } @override @@ -33,13 +37,15 @@ class MapState { return other is MapState && other.isDarkTheme == isDarkTheme && other.showFavoriteOnly == showFavoriteOnly && - other.relativeTime == relativeTime; + other.relativeTime == relativeTime && + other.includeArchived == includeArchived; } @override int get hashCode { return isDarkTheme.hashCode ^ showFavoriteOnly.hashCode ^ - relativeTime.hashCode; + relativeTime.hashCode ^ + includeArchived.hashCode; } } diff --git a/mobile/lib/modules/map/providers/map_marker.provider.dart b/mobile/lib/modules/map/providers/map_marker.provider.dart index 30343f2806..d9541c72cc 100644 --- a/mobile/lib/modules/map/providers/map_marker.provider.dart +++ b/mobile/lib/modules/map/providers/map_marker.provider.dart @@ -10,6 +10,7 @@ final mapMarkersProvider = final mapState = ref.read(mapStateNotifier); DateTime? fileCreatedAfter; bool? isFavorite; + bool? isIncludeArchived; if (mapState.relativeTime != 0) { fileCreatedAfter = @@ -20,8 +21,13 @@ final mapMarkersProvider = isFavorite = true; } + if (!mapState.includeArchived) { + isIncludeArchived = false; + } + final markers = await service.getMapMarkers( isFavorite: isFavorite, + withArchived: isIncludeArchived, fileCreatedAfter: fileCreatedAfter, ); diff --git a/mobile/lib/modules/map/providers/map_state.provider.dart b/mobile/lib/modules/map/providers/map_state.provider.dart index 7fd7d60614..46f49bdaf1 100644 --- a/mobile/lib/modules/map/providers/map_state.provider.dart +++ b/mobile/lib/modules/map/providers/map_state.provider.dart @@ -11,6 +11,8 @@ class MapStateNotifier extends StateNotifier { .getSetting(AppSettingsEnum.mapThemeMode), showFavoriteOnly: appSettingsProvider .getSetting(AppSettingsEnum.mapShowFavoriteOnly), + includeArchived: appSettingsProvider + .getSetting(AppSettingsEnum.mapIncludeArchived), relativeTime: appSettingsProvider .getSetting(AppSettingsEnum.mapRelativeDate), ), @@ -31,11 +33,19 @@ class MapStateNotifier extends StateNotifier { void switchFavoriteOnly(bool isFavoriteOnly) { appSettingsProvider.setSetting( AppSettingsEnum.mapShowFavoriteOnly, - appSettingsProvider, + isFavoriteOnly, ); state = state.copyWith(showFavoriteOnly: isFavoriteOnly); } + void switchIncludeArchived(bool isIncludeArchived) { + appSettingsProvider.setSetting( + AppSettingsEnum.mapIncludeArchived, + isIncludeArchived, + ); + state = state.copyWith(includeArchived: isIncludeArchived); + } + void setRelativeTime(int relativeTime) { appSettingsProvider.setSetting( AppSettingsEnum.mapRelativeDate, diff --git a/mobile/lib/modules/map/services/map.service.dart b/mobile/lib/modules/map/services/map.service.dart index ec8dbbb39e..468669bc71 100644 --- a/mobile/lib/modules/map/services/map.service.dart +++ b/mobile/lib/modules/map/services/map.service.dart @@ -23,12 +23,14 @@ class MapSerivce { Future> getMapMarkers({ bool? isFavorite, + bool? withArchived, DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, }) async { try { final markers = await _apiService.assetApi.getMapMarkers( isFavorite: isFavorite, + isArchived: withArchived, fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, ); diff --git a/mobile/lib/modules/map/ui/map_settings_dialog.dart b/mobile/lib/modules/map/ui/map_settings_dialog.dart index d04ff2b85b..f8a308b35f 100644 --- a/mobile/lib/modules/map/ui/map_settings_dialog.dart +++ b/mobile/lib/modules/map/ui/map_settings_dialog.dart @@ -13,6 +13,7 @@ class MapSettingsDialog extends HookConsumerWidget { final mapSettings = ref.read(mapStateNotifier); final isDarkMode = useState(mapSettings.isDarkTheme); final showFavoriteOnly = useState(mapSettings.showFavoriteOnly); + final showIncludeArchived = useState(mapSettings.includeArchived); final showRelativeDate = useState(mapSettings.relativeTime); final ThemeData theme = Theme.of(context); @@ -48,6 +49,22 @@ class MapSettingsDialog extends HookConsumerWidget { ); } + Widget buildIncludeArchivedSetting() { + return SwitchListTile.adaptive( + value: showIncludeArchived.value, + onChanged: (value) { + showIncludeArchived.value = value; + }, + activeColor: theme.primaryColor, + dense: true, + title: Text( + "map_settings_include_show_archived".tr(), + style: + theme.textTheme.labelLarge?.copyWith(fontWeight: FontWeight.bold), + ), + ); + } + Widget buildDateRangeSetting() { final now = DateTime.now(); return DropdownMenu( @@ -127,6 +144,8 @@ class MapSettingsDialog extends HookConsumerWidget { mapSettingsNotifier.switchTheme(isDarkMode.value); mapSettingsNotifier.switchFavoriteOnly(showFavoriteOnly.value); mapSettingsNotifier.setRelativeTime(showRelativeDate.value); + mapSettingsNotifier + .switchIncludeArchived(showIncludeArchived.value); Navigator.of(context).pop(); }, style: TextButton.styleFrom( @@ -166,6 +185,7 @@ class MapSettingsDialog extends HookConsumerWidget { children: [ buildMapThemeSetting(), buildFavoriteOnlySetting(), + buildIncludeArchivedSetting(), const SizedBox( height: 10, ), diff --git a/mobile/lib/modules/map/views/map_page.dart b/mobile/lib/modules/map/views/map_page.dart index c8fc7f5e9d..ffa18d37a7 100644 --- a/mobile/lib/modules/map/views/map_page.dart +++ b/mobile/lib/modules/map/views/map_page.dart @@ -155,7 +155,8 @@ class MapPageState extends ConsumerState { ref.listen(mapStateNotifier, (previous, next) { bool shouldRefetch = previous?.showFavoriteOnly != next.showFavoriteOnly || - previous?.relativeTime != next.relativeTime; + previous?.relativeTime != next.relativeTime || + previous?.includeArchived != next.includeArchived; if (shouldRefetch) { refetchMarkers.value = shouldRefetch; ref.invalidate(mapMarkersProvider); diff --git a/mobile/lib/modules/settings/services/app_settings.service.dart b/mobile/lib/modules/settings/services/app_settings.service.dart index 774ee1b2f7..657e916bfa 100644 --- a/mobile/lib/modules/settings/services/app_settings.service.dart +++ b/mobile/lib/modules/settings/services/app_settings.service.dart @@ -48,6 +48,7 @@ enum AppSettingsEnum { preferRemoteImage(StoreKey.preferRemoteImage, null, false), mapThemeMode(StoreKey.mapThemeMode, null, false), mapShowFavoriteOnly(StoreKey.mapShowFavoriteOnly, null, false), + mapIncludeArchived(StoreKey.mapIncludeArchived, null, false), mapRelativeDate(StoreKey.mapRelativeDate, null, 0), allowSelfSignedSSLCert(StoreKey.selfSignedCert, null, false), ; diff --git a/mobile/lib/shared/models/store.dart b/mobile/lib/shared/models/store.dart index 54b0c595cb..8f24899f1e 100644 --- a/mobile/lib/shared/models/store.dart +++ b/mobile/lib/shared/models/store.dart @@ -179,6 +179,7 @@ enum StoreKey { mapShowFavoriteOnly(118, type: bool), mapRelativeDate(119, type: int), selfSignedCert(120, type: bool), + mapIncludeArchived(121, type: bool), ; const StoreKey( diff --git a/mobile/openapi/doc/AssetApi.md b/mobile/openapi/doc/AssetApi.md index 251ca458b3..f7511c8144 100644 Binary files a/mobile/openapi/doc/AssetApi.md and b/mobile/openapi/doc/AssetApi.md differ diff --git a/mobile/openapi/lib/api/asset_api.dart b/mobile/openapi/lib/api/asset_api.dart index c2c5fd021c..cdab82f741 100644 Binary files a/mobile/openapi/lib/api/asset_api.dart and b/mobile/openapi/lib/api/asset_api.dart differ diff --git a/mobile/openapi/test/asset_api_test.dart b/mobile/openapi/test/asset_api_test.dart index c300501986..6098a34d73 100644 Binary files a/mobile/openapi/test/asset_api_test.dart and b/mobile/openapi/test/asset_api_test.dart differ diff --git a/server/immich-openapi-specs.json b/server/immich-openapi-specs.json index 46e7e911c3..c5ba92e60e 100644 --- a/server/immich-openapi-specs.json +++ b/server/immich-openapi-specs.json @@ -1406,6 +1406,14 @@ "get": { "operationId": "getMapMarkers", "parameters": [ + { + "name": "isArchived", + "required": false, + "in": "query", + "schema": { + "type": "boolean" + } + }, { "name": "isFavorite", "required": false, diff --git a/server/src/domain/asset/asset.repository.ts b/server/src/domain/asset/asset.repository.ts index 88af992fd6..80d0a7a569 100644 --- a/server/src/domain/asset/asset.repository.ts +++ b/server/src/domain/asset/asset.repository.ts @@ -22,6 +22,7 @@ export interface LivePhotoSearchOptions { } export interface MapMarkerSearchOptions { + isArchived?: boolean; isFavorite?: boolean; fileCreatedBefore?: Date; fileCreatedAfter?: Date; diff --git a/server/src/domain/asset/dto/map-marker.dto.ts b/server/src/domain/asset/dto/map-marker.dto.ts index a93287a166..79bb9fa385 100644 --- a/server/src/domain/asset/dto/map-marker.dto.ts +++ b/server/src/domain/asset/dto/map-marker.dto.ts @@ -4,6 +4,12 @@ import { IsBoolean, IsDate } from 'class-validator'; import { Optional, toBoolean } from '../../domain.util'; export class MapMarkerDto { + @ApiProperty() + @Optional() + @IsBoolean() + @Transform(toBoolean) + isArchived?: boolean; + @ApiProperty() @Optional() @IsBoolean() diff --git a/server/src/infra/repositories/asset.repository.ts b/server/src/infra/repositories/asset.repository.ts index e35d25042a..b22c30893d 100644 --- a/server/src/infra/repositories/asset.repository.ts +++ b/server/src/infra/repositories/asset.repository.ts @@ -355,7 +355,7 @@ export class AssetRepository implements IAssetRepository { } async getMapMarkers(ownerId: string, options: MapMarkerSearchOptions = {}): Promise { - const { isFavorite, fileCreatedAfter, fileCreatedBefore } = options; + const { isArchived, isFavorite, fileCreatedAfter, fileCreatedBefore } = options; const assets = await this.repository.find({ select: { @@ -368,7 +368,7 @@ export class AssetRepository implements IAssetRepository { where: { ownerId, isVisible: true, - isArchived: false, + isArchived, exifInfo: { latitude: Not(IsNull()), longitude: Not(IsNull()), diff --git a/server/test/e2e/asset.e2e-spec.ts b/server/test/e2e/asset.e2e-spec.ts index 3f0ace78af..8c890d8a34 100644 --- a/server/test/e2e/asset.e2e-spec.ts +++ b/server/test/e2e/asset.e2e-spec.ts @@ -56,6 +56,7 @@ const createAsset = ( deviceAssetId: `test_${id}`, deviceId: 'e2e-test', libraryId, + isVisible: true, fileCreatedAt: createdAt, fileModifiedAt: new Date(), type: AssetType.IMAGE, @@ -89,19 +90,25 @@ describe(`${AssetController.name} (e2e)`, () => { await api.authApi.adminSignUp(server); const admin = await api.authApi.adminLogin(server); - const libraries = await api.libraryApi.getAll(server, admin.accessToken); + const [libraries] = await Promise.all([ + api.libraryApi.getAll(server, admin.accessToken), + api.userApi.create(server, admin.accessToken, user1Dto), + api.userApi.create(server, admin.accessToken, user2Dto), + ]); + const defaultLibrary = libraries[0]; - await api.userApi.create(server, admin.accessToken, user1Dto); - user1 = await api.authApi.login(server, { email: user1Dto.email, password: user1Dto.password }); + [user1, user2] = await Promise.all([ + api.authApi.login(server, { email: user1Dto.email, password: user1Dto.password }), + api.authApi.login(server, { email: user2Dto.email, password: user2Dto.password }), + ]); - asset1 = await createAsset(assetRepository, user1, defaultLibrary.id, new Date('1970-01-01')); - asset2 = await createAsset(assetRepository, user1, defaultLibrary.id, new Date('1970-01-02')); - asset3 = await createAsset(assetRepository, user1, defaultLibrary.id, new Date('1970-02-01')); - - await api.userApi.create(server, admin.accessToken, user2Dto); - user2 = await api.authApi.login(server, { email: user2Dto.email, password: user2Dto.password }); - asset4 = await createAsset(assetRepository, user2, defaultLibrary.id, new Date('1970-01-01')); + [asset1, asset2, asset3, asset4] = await Promise.all([ + createAsset(assetRepository, user1, defaultLibrary.id, new Date('1970-01-01')), + createAsset(assetRepository, user1, defaultLibrary.id, new Date('1970-01-02')), + createAsset(assetRepository, user1, defaultLibrary.id, new Date('1970-02-01')), + createAsset(assetRepository, user2, defaultLibrary.id, new Date('1970-01-01')), + ]); }); afterAll(async () => { @@ -515,4 +522,45 @@ describe(`${AssetController.name} (e2e)`, () => { ); }); }); + + describe('GET /asset/map-marker', () => { + beforeEach(async () => { + await assetRepository.save({ id: asset1.id, isArchived: true }); + await assetRepository.upsertExif({ assetId: asset1.id, latitude: 0, longitude: 0 }); + await assetRepository.upsertExif({ assetId: asset2.id, latitude: 0, longitude: 0 }); + }); + + it('should require authentication', async () => { + const { status, body } = await request(server).get('/asset/map-marker'); + + expect(status).toBe(401); + expect(body).toEqual(errorStub.unauthorized); + }); + + it('should get map markers for all non-archived assets', async () => { + const { status, body } = await request(server) + .get('/asset/map-marker') + .set('Authorization', `Bearer ${user1.accessToken}`); + + expect(status).toBe(200); + expect(body).toHaveLength(2); + expect(body).toEqual( + expect.arrayContaining([ + expect.objectContaining({ id: asset1.id }), + expect.objectContaining({ id: asset2.id }), + ]), + ); + }); + + it('should get all map markers', async () => { + const { status, body } = await request(server) + .get('/asset/map-marker') + .set('Authorization', `Bearer ${user1.accessToken}`) + .query({ isArchived: false }); + + expect(status).toBe(200); + expect(body).toHaveLength(1); + expect(body).toEqual([expect.objectContaining({ id: asset2.id })]); + }); + }); }); diff --git a/web/src/api/open-api/api.ts b/web/src/api/open-api/api.ts index 4d0bf0f469..fb194b7fa4 100644 --- a/web/src/api/open-api/api.ts +++ b/web/src/api/open-api/api.ts @@ -6278,13 +6278,14 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration }, /** * + * @param {boolean} [isArchived] * @param {boolean} [isFavorite] * @param {string} [fileCreatedAfter] * @param {string} [fileCreatedBefore] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getMapMarkers: async (isFavorite?: boolean, fileCreatedAfter?: string, fileCreatedBefore?: string, options: AxiosRequestConfig = {}): Promise => { + getMapMarkers: async (isArchived?: boolean, isFavorite?: boolean, fileCreatedAfter?: string, fileCreatedBefore?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/asset/map-marker`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -6306,6 +6307,10 @@ export const AssetApiAxiosParamCreator = function (configuration?: Configuration // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) + if (isArchived !== undefined) { + localVarQueryParameter['isArchived'] = isArchived; + } + if (isFavorite !== undefined) { localVarQueryParameter['isFavorite'] = isFavorite; } @@ -7134,14 +7139,15 @@ export const AssetApiFp = function(configuration?: Configuration) { }, /** * + * @param {boolean} [isArchived] * @param {boolean} [isFavorite] * @param {string} [fileCreatedAfter] * @param {string} [fileCreatedBefore] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getMapMarkers(isFavorite?: boolean, fileCreatedAfter?: string, fileCreatedBefore?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getMapMarkers(isFavorite, fileCreatedAfter, fileCreatedBefore, options); + async getMapMarkers(isArchived?: boolean, isFavorite?: boolean, fileCreatedAfter?: string, fileCreatedBefore?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMapMarkers(isArchived, isFavorite, fileCreatedAfter, fileCreatedBefore, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -7428,7 +7434,7 @@ export const AssetApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getMapMarkers(requestParameters: AssetApiGetMapMarkersRequest = {}, options?: AxiosRequestConfig): AxiosPromise> { - return localVarFp.getMapMarkers(requestParameters.isFavorite, requestParameters.fileCreatedAfter, requestParameters.fileCreatedBefore, options).then((request) => request(axios, basePath)); + return localVarFp.getMapMarkers(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.fileCreatedAfter, requestParameters.fileCreatedBefore, options).then((request) => request(axios, basePath)); }, /** * @@ -7846,6 +7852,13 @@ export interface AssetApiGetDownloadInfoRequest { * @interface AssetApiGetMapMarkersRequest */ export interface AssetApiGetMapMarkersRequest { + /** + * + * @type {boolean} + * @memberof AssetApiGetMapMarkers + */ + readonly isArchived?: boolean + /** * * @type {boolean} @@ -8374,7 +8387,7 @@ export class AssetApi extends BaseAPI { * @memberof AssetApi */ public getMapMarkers(requestParameters: AssetApiGetMapMarkersRequest = {}, options?: AxiosRequestConfig) { - return AssetApiFp(this.configuration).getMapMarkers(requestParameters.isFavorite, requestParameters.fileCreatedAfter, requestParameters.fileCreatedBefore, options).then((request) => request(this.axios, this.basePath)); + return AssetApiFp(this.configuration).getMapMarkers(requestParameters.isArchived, requestParameters.isFavorite, requestParameters.fileCreatedAfter, requestParameters.fileCreatedBefore, options).then((request) => request(this.axios, this.basePath)); } /** diff --git a/web/src/lib/components/map-page/map-settings-modal.svelte b/web/src/lib/components/map-page/map-settings-modal.svelte index c138e7a37d..c2d8a5f655 100644 --- a/web/src/lib/components/map-page/map-settings-modal.svelte +++ b/web/src/lib/components/map-page/map-settings-modal.svelte @@ -32,6 +32,7 @@ > + {#if customDateRange}
diff --git a/web/src/lib/stores/preferences.store.ts b/web/src/lib/stores/preferences.store.ts index 211b71efac..b332e6d5ed 100644 --- a/web/src/lib/stores/preferences.store.ts +++ b/web/src/lib/stores/preferences.store.ts @@ -21,6 +21,7 @@ export const locale = persisted('locale', undefined, { export interface MapSettings { allowDarkMode: boolean; + includeArchived: boolean; onlyFavorites: boolean; relativeDate: string; dateAfter: string; @@ -29,6 +30,7 @@ export interface MapSettings { export const mapSettings = persisted('map-settings', { allowDarkMode: true, + includeArchived: false, onlyFavorites: false, relativeDate: '', dateAfter: '', diff --git a/web/src/routes/(user)/map/+page.svelte b/web/src/routes/(user)/map/+page.svelte index 910449e7bd..5f3ecc1c76 100644 --- a/web/src/routes/(user)/map/+page.svelte +++ b/web/src/routes/(user)/map/+page.svelte @@ -44,11 +44,12 @@ } abortController = new AbortController(); - const { onlyFavorites } = $mapSettings; + const { includeArchived, onlyFavorites } = $mapSettings; const { fileCreatedAfter, fileCreatedBefore } = getFileCreatedDates(); const { data } = await api.assetApi.getMapMarkers( { + isArchived: includeArchived && undefined, isFavorite: onlyFavorites || undefined, fileCreatedAfter: fileCreatedAfter || undefined, fileCreatedBefore,