mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -05:00 
			
		
		
		
	Revert "feat(mobile): upload image assets before videos (#3872)"
This reverts commit 912a13ea0de3303624b38714e8d337551b4c4ef1.
This commit is contained in:
		
							parent
							
								
									585330b179
								
							
						
					
					
						commit
						78eeebf8e6
					
				@ -218,18 +218,7 @@ class BackupService {
 | 
				
			|||||||
    bool anyErrors = false;
 | 
					    bool anyErrors = false;
 | 
				
			||||||
    final List<String> duplicatedAssetIds = [];
 | 
					    final List<String> duplicatedAssetIds = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Upload images before video assets
 | 
					    for (var entity in assetList) {
 | 
				
			||||||
    // these are further sorted by using their creation date so the upload goes as follows
 | 
					 | 
				
			||||||
    // older images -> latest images -> older videos -> latest videos
 | 
					 | 
				
			||||||
    List<AssetEntity> 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) {
 | 
					 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        if (entity.type == AssetType.video) {
 | 
					        if (entity.type == AssetType.video) {
 | 
				
			||||||
          file = await entity.originFile;
 | 
					          file = await entity.originFile;
 | 
				
			||||||
@ -259,8 +248,7 @@ class BackupService {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
          req.fields['deviceAssetId'] = entity.id;
 | 
					          req.fields['deviceAssetId'] = entity.id;
 | 
				
			||||||
          req.fields['deviceId'] = deviceId;
 | 
					          req.fields['deviceId'] = deviceId;
 | 
				
			||||||
          req.fields['fileCreatedAt'] =
 | 
					          req.fields['fileCreatedAt'] = entity.createDateTime.toUtc().toIso8601String();
 | 
				
			||||||
              entity.createDateTime.toUtc().toIso8601String();
 | 
					 | 
				
			||||||
          req.fields['fileModifiedAt'] =
 | 
					          req.fields['fileModifiedAt'] =
 | 
				
			||||||
              entity.modifiedDateTime.toUtc().toIso8601String();
 | 
					              entity.modifiedDateTime.toUtc().toIso8601String();
 | 
				
			||||||
          req.fields['isFavorite'] = entity.isFavorite.toString();
 | 
					          req.fields['isFavorite'] = entity.isFavorite.toString();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user