diff --git a/mobile/lib/domain/services/hash.service.dart b/mobile/lib/domain/services/hash.service.dart index 8be3c2f22..678150756 100644 --- a/mobile/lib/domain/services/hash.service.dart +++ b/mobile/lib/domain/services/hash.service.dart @@ -41,7 +41,7 @@ class HashService { final Stopwatch stopwatch = Stopwatch()..start(); try { // Migrate hashes from cloud ID to local ID so we don't have to re-hash them - await _localAssetRepository.reconcileHashesFromCloudId(); + // await _localAssetRepository.reconcileHashesFromCloudId(); // Sorted by backupSelection followed by isCloud final localAlbums = await _localAlbumRepository.getBackupAlbums(); diff --git a/mobile/lib/domain/services/local_sync.service.dart b/mobile/lib/domain/services/local_sync.service.dart index e4a129d32..868f15315 100644 --- a/mobile/lib/domain/services/local_sync.service.dart +++ b/mobile/lib/domain/services/local_sync.service.dart @@ -19,6 +19,7 @@ import 'package:logging/logging.dart'; class LocalSyncService { final DriftLocalAlbumRepository _localAlbumRepository; + // ignore: unused_field final DriftLocalAssetRepository _localAssetRepository; final NativeSyncApi _nativeSyncApi; final DriftTrashedLocalAssetRepository _trashedLocalAssetRepository; @@ -53,8 +54,8 @@ class LocalSyncService { } if (CurrentPlatform.isIOS) { - final assets = await _localAssetRepository.getEmptyCloudIdAssets(); - await _mapIosCloudIds(assets); + // final assets = await _localAssetRepository.getEmptyCloudIdAssets(); + // await _mapIosCloudIds(assets); } if (full || await _nativeSyncApi.shouldFullSync()) { @@ -306,27 +307,28 @@ class LocalSyncService { return true; } + // ignore: avoid-unused-parameters Future _mapIosCloudIds(List assets) async { - if (!CurrentPlatform.isIOS || assets.isEmpty) { - return; - } + // if (!CurrentPlatform.isIOS || assets.isEmpty) { + return; + // } - final assetIds = assets.map((a) => a.id).toList(); - final cloudMapping = {}; - final cloudIds = await _nativeSyncApi.getCloudIdForAssetIds(assetIds); - for (int i = 0; i < cloudIds.length; i++) { - final cloudIdResult = cloudIds[i]; - if (cloudIdResult.cloudId != null) { - cloudMapping[cloudIdResult.assetId] = cloudIdResult.cloudId!; - } else { - final asset = assets.firstWhereOrNull((a) => a.id == cloudIdResult.assetId); - _log.fine( - "Cannot fetch cloudId for asset with id: ${cloudIdResult.assetId}, name: ${asset?.name}, createdAt: ${asset?.createdAt}. Error: ${cloudIdResult.error ?? "unknown"}", - ); - } - } + // final assetIds = assets.map((a) => a.id).toList(); + // final cloudMapping = {}; + // final cloudIds = await _nativeSyncApi.getCloudIdForAssetIds(assetIds); + // for (int i = 0; i < cloudIds.length; i++) { + // final cloudIdResult = cloudIds[i]; + // if (cloudIdResult.cloudId != null) { + // cloudMapping[cloudIdResult.assetId] = cloudIdResult.cloudId!; + // } else { + // final asset = assets.firstWhereOrNull((a) => a.id == cloudIdResult.assetId); + // _log.fine( + // "Cannot fetch cloudId for asset with id: ${cloudIdResult.assetId}, name: ${asset?.name}, createdAt: ${asset?.createdAt}. Error: ${cloudIdResult.error ?? "unknown"}", + // ); + // } + // } - await _localAlbumRepository.updateCloudMapping(cloudMapping); + // await _localAlbumRepository.updateCloudMapping(cloudMapping); } bool _assetsEqual(LocalAsset a, LocalAsset b) {