fix: actionFaceGalleryAdd now registers person/photo in SQLite DB
This commit is contained in:
parent
248f62ca5d
commit
32fcd43801
@ -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)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user