Backend: Fix search query (photo:true filter)

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-05-14 22:49:01 +02:00
parent d511a5c10a
commit eba0b1d896

View file

@ -59,7 +59,7 @@ func Photos(f form.PhotoSearch) (results PhotosResults, count int, err error) {
if f.Video {
s = s.Where("(files.file_type = 'jpg' OR files.file_video = 1) AND photos.photo_video = 1")
} else if f.Photo {
s = s.Where("files.file_type = 'jpg' AND photos.photo_video = 1")
s = s.Where("files.file_type = 'jpg' AND photos.photo_video = 0")
} else {
s = s.Where("(files.file_type = 'jpg' OR files.file_video = 1)")
}