mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
remove unused keys
This commit is contained in:
@@ -20,14 +20,10 @@ enum StoreKey<T> {
|
|||||||
sslClientCertData<String>._(15),
|
sslClientCertData<String>._(15),
|
||||||
sslClientPasswd<String>._(16),
|
sslClientPasswd<String>._(16),
|
||||||
// user settings from [AppSettingsEnum] below:
|
// user settings from [AppSettingsEnum] below:
|
||||||
loadPreview<bool>._(100),
|
|
||||||
loadOriginal<bool>._(101),
|
loadOriginal<bool>._(101),
|
||||||
tilesPerRow<int>._(103),
|
tilesPerRow<int>._(103),
|
||||||
dynamicLayout<bool>._(104),
|
|
||||||
groupAssetsBy<int>._(105),
|
groupAssetsBy<int>._(105),
|
||||||
uploadErrorNotificationGracePeriod<int>._(106),
|
uploadErrorNotificationGracePeriod<int>._(106),
|
||||||
backgroundBackupTotalProgress<bool>._(107),
|
|
||||||
backgroundBackupSingleProgress<bool>._(108),
|
|
||||||
storageIndicator<bool>._(109),
|
storageIndicator<bool>._(109),
|
||||||
thumbnailCacheSize<int>._(110),
|
thumbnailCacheSize<int>._(110),
|
||||||
imageCacheSize<int>._(111),
|
imageCacheSize<int>._(111),
|
||||||
@@ -37,7 +33,6 @@ enum StoreKey<T> {
|
|||||||
preferRemoteImage<bool>._(116),
|
preferRemoteImage<bool>._(116),
|
||||||
loopVideo<bool>._(117),
|
loopVideo<bool>._(117),
|
||||||
selfSignedCert<bool>._(120),
|
selfSignedCert<bool>._(120),
|
||||||
ignoreIcloudAssets<bool>._(122),
|
|
||||||
selectedAlbumSortReverse<bool>._(123),
|
selectedAlbumSortReverse<bool>._(123),
|
||||||
enableHapticFeedback<bool>._(126),
|
enableHapticFeedback<bool>._(126),
|
||||||
customHeaders<String>._(127),
|
customHeaders<String>._(127),
|
||||||
@@ -64,17 +59,9 @@ enum StoreKey<T> {
|
|||||||
tapToNavigate<bool>._(141),
|
tapToNavigate<bool>._(141),
|
||||||
|
|
||||||
// Experimental stuff
|
// Experimental stuff
|
||||||
photoManagerCustomFilter<bool>._(1000),
|
|
||||||
betaPromptShown<bool>._(1001),
|
|
||||||
betaTimeline<bool>._(1002),
|
|
||||||
enableBackup<bool>._(1003),
|
enableBackup<bool>._(1003),
|
||||||
useWifiForUploadVideos<bool>._(1004),
|
useWifiForUploadVideos<bool>._(1004),
|
||||||
useWifiForUploadPhotos<bool>._(1005),
|
useWifiForUploadPhotos<bool>._(1005),
|
||||||
needBetaMigration<bool>._(1006),
|
|
||||||
// TODO: Remove this after patching open-api
|
|
||||||
shouldResetSync<bool>._(1007),
|
|
||||||
|
|
||||||
// Free up space
|
|
||||||
syncMigrationStatus<String>._(1013),
|
syncMigrationStatus<String>._(1013),
|
||||||
|
|
||||||
// Legacy keys that have been migrated to the new metadata store
|
// Legacy keys that have been migrated to the new metadata store
|
||||||
|
|||||||
@@ -93,8 +93,7 @@ class LocalSyncService {
|
|||||||
|
|
||||||
if (CurrentPlatform.isIOS) {
|
if (CurrentPlatform.isIOS) {
|
||||||
// On iOS, we need to full sync albums that are marked as cloud as the delta sync
|
// On iOS, we need to full sync albums that are marked as cloud as the delta sync
|
||||||
// does not include changes for cloud albums. If ignoreIcloudAssets is enabled,
|
// does not include changes for cloud albums.
|
||||||
// remove the albums from the local database from the previous sync
|
|
||||||
final cloudAlbums = deviceAlbums.where((a) => a.isCloud).toLocalAlbums();
|
final cloudAlbums = deviceAlbums.where((a) => a.isCloud).toLocalAlbums();
|
||||||
for (final album in cloudAlbums) {
|
for (final album in cloudAlbums) {
|
||||||
final dbAlbum = dbAlbums.firstWhereOrNull((a) => a.id == album.id);
|
final dbAlbum = dbAlbums.firstWhereOrNull((a) => a.id == album.id);
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:immich_mobile/constants/constants.dart';
|
import 'package:immich_mobile/constants/constants.dart';
|
||||||
import 'package:immich_mobile/domain/models/store.model.dart';
|
|
||||||
import 'package:immich_mobile/domain/models/sync_event.model.dart';
|
import 'package:immich_mobile/domain/models/sync_event.model.dart';
|
||||||
import 'package:immich_mobile/entities/store.entity.dart';
|
|
||||||
import 'package:immich_mobile/infrastructure/repositories/network.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/network.repository.dart';
|
||||||
import 'package:immich_mobile/services/api.service.dart';
|
import 'package:immich_mobile/services/api.service.dart';
|
||||||
import 'package:immich_mobile/utils/semver.dart';
|
import 'package:immich_mobile/utils/semver.dart';
|
||||||
@@ -38,7 +36,6 @@ class SyncApiRepository {
|
|||||||
|
|
||||||
final headers = {'Content-Type': 'application/json', 'Accept': 'application/jsonlines+json'};
|
final headers = {'Content-Type': 'application/json', 'Accept': 'application/jsonlines+json'};
|
||||||
|
|
||||||
final shouldReset = Store.get(StoreKey.shouldResetSync, false);
|
|
||||||
final request = http.Request('POST', Uri.parse(endpoint));
|
final request = http.Request('POST', Uri.parse(endpoint));
|
||||||
request.headers.addAll(headers);
|
request.headers.addAll(headers);
|
||||||
request.body = jsonEncode(
|
request.body = jsonEncode(
|
||||||
@@ -77,7 +74,6 @@ class SyncApiRepository {
|
|||||||
? SyncRequestType.assetFacesV2
|
? SyncRequestType.assetFacesV2
|
||||||
: SyncRequestType.assetFacesV1,
|
: SyncRequestType.assetFacesV1,
|
||||||
],
|
],
|
||||||
reset: shouldReset,
|
|
||||||
).toJson(),
|
).toJson(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -101,9 +97,6 @@ class SyncApiRepository {
|
|||||||
throw ApiException(response.statusCode, 'Failed to get sync stream: $errorBody');
|
throw ApiException(response.statusCode, 'Failed to get sync stream: $errorBody');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset after successful stream start
|
|
||||||
await Store.put(StoreKey.shouldResetSync, false);
|
|
||||||
|
|
||||||
await for (final chunk in response.stream.transform(utf8.decoder)) {
|
await for (final chunk in response.stream.transform(utf8.decoder)) {
|
||||||
if (shouldAbort) {
|
if (shouldAbort) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -2,22 +2,14 @@ import 'package:immich_mobile/domain/models/store.model.dart';
|
|||||||
import 'package:immich_mobile/entities/store.entity.dart';
|
import 'package:immich_mobile/entities/store.entity.dart';
|
||||||
|
|
||||||
enum AppSettingsEnum<T> {
|
enum AppSettingsEnum<T> {
|
||||||
loadPreview<bool>(StoreKey.loadPreview, "loadPreview", true),
|
|
||||||
loadOriginal<bool>(StoreKey.loadOriginal, "loadOriginal", false),
|
loadOriginal<bool>(StoreKey.loadOriginal, "loadOriginal", false),
|
||||||
tilesPerRow<int>(StoreKey.tilesPerRow, "tilesPerRow", 4),
|
tilesPerRow<int>(StoreKey.tilesPerRow, "tilesPerRow", 4),
|
||||||
dynamicLayout<bool>(StoreKey.dynamicLayout, "dynamicLayout", false),
|
|
||||||
groupAssetsBy<int>(StoreKey.groupAssetsBy, "groupBy", 0),
|
groupAssetsBy<int>(StoreKey.groupAssetsBy, "groupBy", 0),
|
||||||
uploadErrorNotificationGracePeriod<int>(
|
uploadErrorNotificationGracePeriod<int>(
|
||||||
StoreKey.uploadErrorNotificationGracePeriod,
|
StoreKey.uploadErrorNotificationGracePeriod,
|
||||||
"uploadErrorNotificationGracePeriod",
|
"uploadErrorNotificationGracePeriod",
|
||||||
2,
|
2,
|
||||||
),
|
),
|
||||||
backgroundBackupTotalProgress<bool>(StoreKey.backgroundBackupTotalProgress, "backgroundBackupTotalProgress", true),
|
|
||||||
backgroundBackupSingleProgress<bool>(
|
|
||||||
StoreKey.backgroundBackupSingleProgress,
|
|
||||||
"backgroundBackupSingleProgress",
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
storageIndicator<bool>(StoreKey.storageIndicator, "storageIndicator", true),
|
storageIndicator<bool>(StoreKey.storageIndicator, "storageIndicator", true),
|
||||||
thumbnailCacheSize<int>(StoreKey.thumbnailCacheSize, "thumbnailCacheSize", 10000),
|
thumbnailCacheSize<int>(StoreKey.thumbnailCacheSize, "thumbnailCacheSize", 10000),
|
||||||
imageCacheSize<int>(StoreKey.imageCacheSize, "imageCacheSize", 350),
|
imageCacheSize<int>(StoreKey.imageCacheSize, "imageCacheSize", 350),
|
||||||
@@ -31,13 +23,10 @@ enum AppSettingsEnum<T> {
|
|||||||
autoPlayVideo<bool>(StoreKey.autoPlayVideo, "autoPlayVideo", true),
|
autoPlayVideo<bool>(StoreKey.autoPlayVideo, "autoPlayVideo", true),
|
||||||
tapToNavigate<bool>(StoreKey.tapToNavigate, "tapToNavigate", false),
|
tapToNavigate<bool>(StoreKey.tapToNavigate, "tapToNavigate", false),
|
||||||
allowSelfSignedSSLCert<bool>(StoreKey.selfSignedCert, null, false),
|
allowSelfSignedSSLCert<bool>(StoreKey.selfSignedCert, null, false),
|
||||||
ignoreIcloudAssets<bool>(StoreKey.ignoreIcloudAssets, null, false),
|
|
||||||
selectedAlbumSortReverse<bool>(StoreKey.selectedAlbumSortReverse, null, true),
|
selectedAlbumSortReverse<bool>(StoreKey.selectedAlbumSortReverse, null, true),
|
||||||
enableHapticFeedback<bool>(StoreKey.enableHapticFeedback, null, true),
|
enableHapticFeedback<bool>(StoreKey.enableHapticFeedback, null, true),
|
||||||
syncAlbums<bool>(StoreKey.syncAlbums, null, false),
|
syncAlbums<bool>(StoreKey.syncAlbums, null, false),
|
||||||
autoEndpointSwitching<bool>(StoreKey.autoEndpointSwitching, null, false),
|
autoEndpointSwitching<bool>(StoreKey.autoEndpointSwitching, null, false),
|
||||||
photoManagerCustomFilter<bool>(StoreKey.photoManagerCustomFilter, null, true),
|
|
||||||
betaTimeline<bool>(StoreKey.betaTimeline, null, true),
|
|
||||||
enableBackup<bool>(StoreKey.enableBackup, null, false),
|
enableBackup<bool>(StoreKey.enableBackup, null, false),
|
||||||
useCellularForUploadVideos<bool>(StoreKey.useWifiForUploadVideos, null, false),
|
useCellularForUploadVideos<bool>(StoreKey.useWifiForUploadVideos, null, false),
|
||||||
useCellularForUploadPhotos<bool>(StoreKey.useWifiForUploadPhotos, null, false),
|
useCellularForUploadPhotos<bool>(StoreKey.useWifiForUploadPhotos, null, false),
|
||||||
|
|||||||
@@ -3,16 +3,15 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|||||||
import 'package:immich_mobile/extensions/translate_extensions.dart';
|
import 'package:immich_mobile/extensions/translate_extensions.dart';
|
||||||
import 'package:immich_mobile/providers/app_settings.provider.dart';
|
import 'package:immich_mobile/providers/app_settings.provider.dart';
|
||||||
import 'package:immich_mobile/services/app_settings.service.dart';
|
import 'package:immich_mobile/services/app_settings.service.dart';
|
||||||
|
import 'package:immich_mobile/utils/hooks/app_settings_update_hook.dart';
|
||||||
import 'package:immich_mobile/widgets/settings/setting_group_title.dart';
|
import 'package:immich_mobile/widgets/settings/setting_group_title.dart';
|
||||||
import 'package:immich_mobile/widgets/settings/settings_switch_list_tile.dart';
|
import 'package:immich_mobile/widgets/settings/settings_switch_list_tile.dart';
|
||||||
import 'package:immich_mobile/utils/hooks/app_settings_update_hook.dart';
|
|
||||||
|
|
||||||
class ImageViewerQualitySetting extends HookConsumerWidget {
|
class ImageViewerQualitySetting extends HookConsumerWidget {
|
||||||
const ImageViewerQualitySetting({super.key});
|
const ImageViewerQualitySetting({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final isPreview = useAppSettingsState(AppSettingsEnum.loadPreview);
|
|
||||||
final isOriginal = useAppSettingsState(AppSettingsEnum.loadOriginal);
|
final isOriginal = useAppSettingsState(AppSettingsEnum.loadOriginal);
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
@@ -23,12 +22,6 @@ class ImageViewerQualitySetting extends HookConsumerWidget {
|
|||||||
icon: Icons.image_outlined,
|
icon: Icons.image_outlined,
|
||||||
subtitle: "setting_image_viewer_help".t(context: context),
|
subtitle: "setting_image_viewer_help".t(context: context),
|
||||||
),
|
),
|
||||||
SettingsSwitchListTile(
|
|
||||||
valueNotifier: isPreview,
|
|
||||||
title: "setting_image_viewer_preview_title".t(context: context),
|
|
||||||
subtitle: "setting_image_viewer_preview_subtitle".t(context: context),
|
|
||||||
onChanged: (_) => ref.invalidate(appSettingsServiceProvider),
|
|
||||||
),
|
|
||||||
SettingsSwitchListTile(
|
SettingsSwitchListTile(
|
||||||
valueNotifier: isOriginal,
|
valueNotifier: isOriginal,
|
||||||
title: "setting_image_viewer_original_title".t(context: context),
|
title: "setting_image_viewer_original_title".t(context: context),
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import 'package:immich_mobile/utils/hooks/app_settings_update_hook.dart';
|
|||||||
import 'package:immich_mobile/widgets/settings/settings_button_list_tile.dart';
|
import 'package:immich_mobile/widgets/settings/settings_button_list_tile.dart';
|
||||||
import 'package:immich_mobile/widgets/settings/settings_slider_list_tile.dart';
|
import 'package:immich_mobile/widgets/settings/settings_slider_list_tile.dart';
|
||||||
import 'package:immich_mobile/widgets/settings/settings_sub_page_scaffold.dart';
|
import 'package:immich_mobile/widgets/settings/settings_sub_page_scaffold.dart';
|
||||||
import 'package:immich_mobile/widgets/settings/settings_switch_list_tile.dart';
|
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
|
||||||
class NotificationSetting extends HookConsumerWidget {
|
class NotificationSetting extends HookConsumerWidget {
|
||||||
@@ -19,8 +18,6 @@ class NotificationSetting extends HookConsumerWidget {
|
|||||||
final permissionService = ref.watch(notificationPermissionProvider);
|
final permissionService = ref.watch(notificationPermissionProvider);
|
||||||
|
|
||||||
final sliderValue = useAppSettingsState(AppSettingsEnum.uploadErrorNotificationGracePeriod);
|
final sliderValue = useAppSettingsState(AppSettingsEnum.uploadErrorNotificationGracePeriod);
|
||||||
final totalProgressValue = useAppSettingsState(AppSettingsEnum.backgroundBackupTotalProgress);
|
|
||||||
final singleProgressValue = useAppSettingsState(AppSettingsEnum.backgroundBackupSingleProgress);
|
|
||||||
|
|
||||||
final hasPermission = permissionService == PermissionStatus.granted;
|
final hasPermission = permissionService == PermissionStatus.granted;
|
||||||
|
|
||||||
@@ -60,18 +57,6 @@ class NotificationSetting extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
SettingsSwitchListTile(
|
|
||||||
enabled: hasPermission,
|
|
||||||
valueNotifier: totalProgressValue,
|
|
||||||
title: 'setting_notifications_total_progress_title'.tr(),
|
|
||||||
subtitle: 'setting_notifications_total_progress_subtitle'.tr(),
|
|
||||||
),
|
|
||||||
SettingsSwitchListTile(
|
|
||||||
enabled: hasPermission,
|
|
||||||
valueNotifier: singleProgressValue,
|
|
||||||
title: 'setting_notifications_single_progress_title'.tr(),
|
|
||||||
subtitle: 'setting_notifications_single_progress_subtitle'.tr(),
|
|
||||||
),
|
|
||||||
SettingsSliderListTile(
|
SettingsSliderListTile(
|
||||||
enabled: hasPermission,
|
enabled: hasPermission,
|
||||||
valueNotifier: sliderValue,
|
valueNotifier: sliderValue,
|
||||||
|
|||||||
Reference in New Issue
Block a user