fix: actionFaceGalleryAdd now registers person/photo in SQLite DB

This commit is contained in:
tian 2026-07-20 15:01:31 +08:00
parent 248f62ca5d
commit 32fcd43801

View File

@ -5299,6 +5299,12 @@ func (u *UI) actionFaceGalleryAdd(w http.ResponseWriter, r *http.Request) {
}
defer f.Close()
io.Copy(f, file)
// Register person and photo in DB so the face gallery list reflects it.
if strings.TrimSpace(u.dbPath) != "" {
repo := storage.NewFaceGalleryRepo(u.dbPath)
pid, _ := repo.FindOrCreatePerson(name)
_ = repo.AddPhoto(pid, name+"/"+hdr.Filename)
}
http.Redirect(w, r, "/ui/face-gallery?msg=ok", http.StatusFound)
}