From 70d8902737cf919dd90c3b9987d0f3cba77cff47 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 29 Aug 2023 14:08:53 -0500 Subject: [PATCH] Revert "feat(mobile): upload image assets before videos (#3872)" (#3910) This reverts commit 912a13ea0de3303624b38714e8d337551b4c4ef1. --- .../modules/backup/services/backup.service.dart | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/mobile/lib/modules/backup/services/backup.service.dart b/mobile/lib/modules/backup/services/backup.service.dart index 8535496e10..678f3a3867 100644 --- a/mobile/lib/modules/backup/services/backup.service.dart +++ b/mobile/lib/modules/backup/services/backup.service.dart @@ -218,18 +218,7 @@ class BackupService { bool anyErrors = false; final List duplicatedAssetIds = []; - // Upload images before video assets - // these are further sorted by using their creation date so the upload goes as follows - // older images -> latest images -> older videos -> latest videos - List sortedAssets = assetList.sorted( - (a, b) { - final cmp = a.typeInt - b.typeInt; - if (cmp != 0) return cmp; - return a.createDateTime.compareTo(b.createDateTime); - }, - ); - - for (var entity in sortedAssets) { + for (var entity in assetList) { try { if (entity.type == AssetType.video) { file = await entity.originFile; @@ -259,8 +248,7 @@ class BackupService { req.fields['deviceAssetId'] = entity.id; req.fields['deviceId'] = deviceId; - req.fields['fileCreatedAt'] = - entity.createDateTime.toUtc().toIso8601String(); + req.fields['fileCreatedAt'] = entity.createDateTime.toUtc().toIso8601String(); req.fields['fileModifiedAt'] = entity.modifiedDateTime.toUtc().toIso8601String(); req.fields['isFavorite'] = entity.isFavorite.toString();