diff --git a/internal/entity/file_fixtures.go b/internal/entity/file_fixtures.go index 28f7eeab7..ee82af20d 100644 --- a/internal/entity/file_fixtures.go +++ b/internal/entity/file_fixtures.go @@ -902,7 +902,7 @@ var FileFixtures = FileMap{ FileCodec: "jpeg", FileType: "raw", FileMime: "image/x-canon-cr2", - FilePrimary: true, + FilePrimary: false, FileSidecar: false, FileVideo: false, FileMissing: false, diff --git a/internal/search/geojson.go b/internal/search/geojson.go index 2c921a081..40dbc2bac 100644 --- a/internal/search/geojson.go +++ b/internal/search/geojson.go @@ -345,7 +345,7 @@ func Geo(f form.SearchGeo) (results GeoResults, err error) { // Sort order. if f.Near != "" { // Sort by distance to UID. - s = s.Order(gorm.Expr("(photos.photo_uid = ?) DESC, ABS((? - photos.photo_lat)*(? - photos.photo_lng))", f.Near, f.Lat, f.Lng)) + s = s.Order(gorm.Expr("(photos.photo_uid = ?) DESC, ABS(? - photos.photo_lat)+ABS(? - photos.photo_lng)", f.Near, f.Lat, f.Lng)) s = s.Limit(1000) } else { // Default.