UX: Update counters and covers in the background #4323

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-03-28 23:20:28 +01:00
parent cef91e442a
commit c6176d0b1e
7 changed files with 61 additions and 23 deletions

View File

@@ -81,10 +81,10 @@ func BatchPhotosArchive(router *gin.RouterGroup) {
}
// Update precalculated photo and file counts.
logWarn("index", entity.UpdateCounts())
entity.UpdateCountsAsync()
// Update album, subject, and label cover thumbs.
logWarn("index", query.UpdateCovers())
query.UpdateCoversAsync()
UpdateClientConfig()
@@ -151,10 +151,10 @@ func BatchPhotosRestore(router *gin.RouterGroup) {
}
// Update precalculated photo and file counts.
logWarn("index", entity.UpdateCounts())
entity.UpdateCountsAsync()
// Update album, subject, and label cover thumbs.
logWarn("index", query.UpdateCovers())
query.UpdateCoversAsync()
UpdateClientConfig()
@@ -339,7 +339,7 @@ func BatchPhotosPrivate(router *gin.RouterGroup) {
}
// Update precalculated photo and file counts.
logWarn("index", entity.UpdateCounts())
entity.UpdateCountsAsync()
// Fetch selection from index.
if photos, err := query.SelectedPhotos(frm); err == nil {
@@ -507,7 +507,7 @@ func BatchPhotosDelete(router *gin.RouterGroup) {
config.FlushUsageCache()
// Update precalculated photo and file counts.
logWarn("index", entity.UpdateCounts())
entity.UpdateCountsAsync()
UpdateClientConfig()