Search: Ignore public album filter if "Private" feat is disabled #2570

This needs to be very well tested and discussed, as these changes can
lead to private photos being accidentally published. Thank you!

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2022-08-01 15:57:19 +02:00
parent 09da41996d
commit d8e0364dbb
91 changed files with 12475 additions and 500 deletions

View File

@@ -52,6 +52,14 @@ type TestForm struct {
Merged bool `form:"merged" serialize:"-"`
}
func (f *TestForm) GetQuery() string {
return f.Query
}
func (f *TestForm) SetQuery(q string) {
f.Query = q
}
func TestSerialize(t *testing.T) {
form := TestForm{
Query: "foo BAR",
@@ -100,3 +108,15 @@ func TestSerialize(t *testing.T) {
assert.Equal(t, "", result)
})
}
func TestUnserialize(t *testing.T) {
form := &TestForm{}
serialized := "q:\"foo BAR\" name:\"yo/ba:z.JPG\" lat:1.500000 lng:-10.333330 chroma:1 diff:424242 year:2002 before:2019-01-15 private:true"
if err := Unserialize(form, serialized); err != nil {
t.Fatal(err)
}
assert.Equal(t, 0, form.Count)
}