only update images where the album is synchronized with the server

This commit is contained in:
Philipp Häfelfinger 2023-09-11 16:28:20 +02:00
parent 3d3cde63dd
commit 6f0e5e06a9

View File

@ -165,7 +165,7 @@ internal class ImageSynchronizer : IImageSynchronizer
private async Task UploadNewImagesToServerAsync(IPiwigoClient piwigoClient, ServerEntity piwigoServer, CancellationToken ct)
{
var imagesToUpload = await _persistenceContext.PiwigoImages.Include(i => i.Album)
.Where(i => i.ServerImageId == null && i.Album.ServerId == piwigoServer.Id)
.Where(i => i.ServerImageId == null && i.Album.ServerId == piwigoServer.Id && i.Album.ServerAlbumId != null)
.ToListAsync(ct);
_logger.LogInformation("Uploading {Count} images", imagesToUpload.Count);