diff --git a/PiwigoDirectorySync/Services/ImageSynchronizer.cs b/PiwigoDirectorySync/Services/ImageSynchronizer.cs index 440d802..a6527a8 100644 --- a/PiwigoDirectorySync/Services/ImageSynchronizer.cs +++ b/PiwigoDirectorySync/Services/ImageSynchronizer.cs @@ -184,6 +184,7 @@ internal class ImageSynchronizer : IImageSynchronizer { var imagesToUpload = await _persistenceContext.PiwigoImages.Include(i => i.Album) .Where(i => i.ServerImageId != null && i.Album.ServerId == piwigoServer.Id && i.UploadRequired && i.ServerImageId != null) + .OrderBy(i => i.FilePath) .ToListAsync(ct); _logger.Information("Updating {Count} images", imagesToUpload.Count); @@ -208,6 +209,7 @@ internal class ImageSynchronizer : IImageSynchronizer { var imagesToUpload = await _persistenceContext.PiwigoImages.Include(i => i.Album) .Where(i => i.ServerImageId == null && i.Album.ServerId == piwigoServer.Id && i.Album.ServerAlbumId != null) + .OrderBy(i => i.FilePath) .ToListAsync(ct); _logger.Information("Uploading {Count} images", imagesToUpload.Count); @@ -245,6 +247,7 @@ internal class ImageSynchronizer : IImageSynchronizer { var imagesToSearch = await _persistenceContext.PiwigoImages.Include(i => i.Album) .Where(i => i.ServerImageId == null && i.Album.ServerId == piwigoServer.Id) + .OrderBy(i => i.FilePath) .ToListAsync(ct); _logger.Information("Checking {Count} images if they exist", imagesToSearch.Count);