diff --git a/internal/web/ui.go b/internal/web/ui.go index c375e20..6f789d6 100644 --- a/internal/web/ui.go +++ b/internal/web/ui.go @@ -1301,15 +1301,27 @@ func (u *UI) actionConsoleSave(w http.ResponseWriter, r *http.Request) { continue } var sources []string + // Merge: existing assignment sources + UI-added sources + sourceSet := map[string]struct{}{} if assignment, err := u.preview.GetDeviceAssignment(dev.DeviceID); err == nil && assignment != nil { for _, ref := range assignment.RecognitionUnits { if unit, err := u.preview.GetRecognitionUnit(ref); err == nil && unit != nil { if unit.VideoSourceRef != "" { - sources = append(sources, unit.VideoSourceRef) + sourceSet[unit.VideoSourceRef] = struct{}{} } } } } + // Read UI-added sources from form (JS adds device_xxx_source hidden inputs) + for _, src := range r.Form["device_"+dev.DeviceID+"_source"] { + src = strings.TrimSpace(src) + if src != "" { + sourceSet[src] = struct{}{} + } + } + for src := range sourceSet { + sources = append(sources, src) + } if len(features) == 0 { continue } diff --git a/safesightd-linux-arm64 b/safesightd-linux-arm64 index f181021..8f4253a 100644 Binary files a/safesightd-linux-arm64 and b/safesightd-linux-arm64 differ