fixes pending count
All checks were successful
PiwigoDirectorySync/pipeline/head This commit looks good
All checks were successful
PiwigoDirectorySync/pipeline/head This commit looks good
This commit is contained in:
parent
662df35f6a
commit
ed43852124
@ -44,7 +44,7 @@ internal class AlbumSynchronizer : IAlbumSynchronizer
|
|||||||
|
|
||||||
public async Task<PendingChange> GetPendingChangesAsync(int piwigoServerId, CancellationToken ct)
|
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 updates = 0; // not yet supported
|
||||||
const int deletes = 0; // not yet supported
|
const int deletes = 0; // not yet supported
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@ internal class ImageSynchronizer : IImageSynchronizer
|
|||||||
|
|
||||||
public async Task<PendingChange> GetPendingChangesAsync(int piwigoServerId, CancellationToken ct)
|
public async Task<PendingChange> GetPendingChangesAsync(int piwigoServerId, CancellationToken ct)
|
||||||
{
|
{
|
||||||
var getOrAdds = await _persistenceContext.PiwigoImages.Where(i => i.ServerImageId == null).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.ServerImageId != null && i.UploadRequired).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.ServerImageId != null && i.DeleteRequired).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);
|
return new PendingChange(getOrAdds, updates, deletes);
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ internal class ImageSynchronizer : IImageSynchronizer
|
|||||||
}
|
}
|
||||||
catch (PiwigoException ex)
|
catch (PiwigoException ex)
|
||||||
{
|
{
|
||||||
_logger.Error(ex,"Could not update image {ImageEntityPath} ({ImageEntityId}) on piwigo server with id {ImageEntityServerImageId}", imageEntity.FilePath,
|
_logger.Error(ex, "Could not update image {ImageEntityPath} ({ImageEntityId}) on piwigo server with id {ImageEntityServerImageId}", imageEntity.FilePath,
|
||||||
imageEntity.Id, imageEntity.ServerImageId);
|
imageEntity.Id, imageEntity.ServerImageId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user