AI: Improve the generation, sorting, and filtering of labels #5232

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-10-02 13:08:46 +02:00
parent ac91c98ed0
commit 746f26724c
70 changed files with 2996 additions and 1882 deletions

View File

@@ -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 {