fixes pending count
All checks were successful
PiwigoDirectorySync/pipeline/head This commit looks good

This commit is contained in:
Philipp Häfelfinger 2023-10-03 22:18:38 +02:00
parent 662df35f6a
commit ed43852124
2 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ internal class AlbumSynchronizer : IAlbumSynchronizer
public async Task<PendingChange> GetPendingChangesAsync(int piwigoServerId, CancellationToken ct)
{
var getOrAdds = await _persistenceContext.PiwigoAlbums.Where(a => a.ServerAlbumId == null).CountAsync(ct);
var getOrAdds = await _persistenceContext.PiwigoAlbums.Where(a => a.ServerAlbumId == null && a.ServerId == piwigoServerId).CountAsync(ct);
const int updates = 0; // not yet supported
const int deletes = 0; // not yet supported

View File

@ -23,9 +23,9 @@ internal class ImageSynchronizer : IImageSynchronizer
public async Task<PendingChange> GetPendingChangesAsync(int piwigoServerId, CancellationToken ct)
{
var getOrAdds = await _persistenceContext.PiwigoImages.Where(i => i.ServerImageId == null).CountAsync(ct);
var updates = await _persistenceContext.PiwigoImages.Where(i => i.ServerImageId != null && i.UploadRequired).CountAsync(ct);
var deletes = await _persistenceContext.PiwigoImages.Where(i => i.ServerImageId != null && i.DeleteRequired).CountAsync(ct);
var getOrAdds = await _persistenceContext.PiwigoImages.Where(i => i.Album.ServerId == piwigoServerId && i.ServerImageId == null).CountAsync(ct);
var updates = await _persistenceContext.PiwigoImages.Where(i => i.Album.ServerId == piwigoServerId && i.ServerImageId != null && i.UploadRequired).CountAsync(ct);
var deletes = await _persistenceContext.PiwigoImages.Where(i => i.Album.ServerId == piwigoServerId && i.ServerImageId != null && i.DeleteRequired).CountAsync(ct);
return new PendingChange(getOrAdds, updates, deletes);
}