mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
AI: Improve the generation, sorting, and filtering of labels #5232
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/auth/acl"
|
||||
"github.com/photoprism/photoprism/internal/entity"
|
||||
"github.com/photoprism/photoprism/internal/entity/search"
|
||||
"github.com/photoprism/photoprism/internal/form"
|
||||
"github.com/photoprism/photoprism/pkg/txt"
|
||||
@@ -42,6 +43,12 @@ func SearchLabels(router *gin.RouterGroup) {
|
||||
return
|
||||
}
|
||||
|
||||
// Update precalculated photo counts if needed.
|
||||
if err = entity.UpdateLabelCountsIfNeeded(); err != nil {
|
||||
log.Warnf("labels: could not update photo counts (%s)", err)
|
||||
}
|
||||
|
||||
// Search matching labels.
|
||||
result, err := search.Labels(frm)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user