CLI: Add txt.JoinAnd() helper function to format lists of items #5233

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-09-29 19:25:47 +02:00
parent 7ae7ce9edd
commit e21174c297
7 changed files with 68 additions and 38 deletions

View File

@@ -23,6 +23,7 @@ import (
"github.com/photoprism/photoprism/pkg/fs"
"github.com/photoprism/photoprism/pkg/i18n"
"github.com/photoprism/photoprism/pkg/media"
"github.com/photoprism/photoprism/pkg/txt"
)
// UploadUserFiles adds files to the user's upload folder from where they can be processed and indexed.
@@ -329,7 +330,7 @@ func ProcessUserUpload(router *gin.RouterGroup) {
// Add imported files to albums if allowed.
if len(frm.Albums) > 0 &&
acl.Rules.AllowAny(acl.ResourceAlbums, s.GetUserRole(), acl.Permissions{acl.ActionCreate, acl.ActionUpload}) {
log.Debugf("upload: adding files to album %s", clean.Log(strings.Join(frm.Albums, " and ")))
log.Debugf("upload: adding files to album %s", clean.Log(txt.JoinAnd(frm.Albums)))
opt.Albums = frm.Albums
}