diff --git a/internal/entity/marker.go b/internal/entity/marker.go index 3382d7bc7..1314c6f5e 100644 --- a/internal/entity/marker.go +++ b/internal/entity/marker.go @@ -277,7 +277,11 @@ func (m *Marker) ClearSubject(src string) (err error) { return err } + m.MarkerName = "" + m.FaceID = "" m.Face = nil + m.SubjectUID = "" + m.SubjectSrc = "" return nil } diff --git a/internal/entity/marker_test.go b/internal/entity/marker_test.go index 114142841..8c66d617e 100644 --- a/internal/entity/marker_test.go +++ b/internal/entity/marker_test.go @@ -132,3 +132,19 @@ func TestMarker_Save(t *testing.T) { t.Logf("FILES: %#v", p.Files) }) } + +func TestMarker_ClearSubject(t *testing.T) { + t.Run("1000003-2", func(t *testing.T) { + m := MarkerFixtures.Get("1000003-2") + + assert.NotEmpty(t, m.MarkerName) + + err := m.ClearSubject(SrcAuto) + + if err != nil { + t.Fatal(err) + } + + assert.Empty(t, m.MarkerName) + }) +}